lib/blather/stanza/pubsub/event.rb in sprsquish-blather-0.4.2 vs lib/blather/stanza/pubsub/event.rb in sprsquish-blather-0.4.3
- old
+ new
@@ -23,19 +23,19 @@
def node
!purge? ? items_node[:node] : purge_node[:node]
end
def retractions
- items_node.find('ns:retract', :ns => self.class.registered_ns).map { |i| i[:id] }
+ items_node.find('//ns:retract', :ns => self.class.registered_ns).map { |i| i[:id] }
end
def retractions?
!retractions.empty?
end
def items
- items_node.find('ns:item', :ns => self.class.registered_ns).map { |i| PubSubItem.new(nil,nil,self.document).inherit i }
+ items_node.find('//ns:item', :ns => self.class.registered_ns).map { |i| PubSubItem.new(nil,nil,self.document).inherit i }
end
def items?
!items.empty?
end
@@ -43,29 +43,29 @@
def purge?
purge_node
end
def event_node
- node = find_first('ns:event', :ns => self.class.registered_ns)
- node = find_first('event', self.class.registered_ns) unless node
+ node = find_first('//ns:event', :ns => self.class.registered_ns)
+ node = find_first('//event', self.class.registered_ns) unless node
unless node
(self << (node = XMPPNode.new('event', self.document)))
node.namespace = self.class.registered_ns
end
node
end
def items_node
- node = find_first('event/ns:items', :ns => self.class.registered_ns)
+ node = find_first('ns:event/ns:items', :ns => self.class.registered_ns)
unless node
(self.event_node << (node = XMPPNode.new('items', self.document)))
node.namespace = event_node.namespace
end
node
end
def purge_node
- event_node.find_first('ns:purge', :ns => self.class.registered_ns)
+ event_node.find_first('//ns:purge', :ns => self.class.registered_ns)
end
def subscription_ids
find('//ns:header[@name="SubID"]', :ns => 'http://jabber.org/protocol/shim').map { |n| n.content }
end