lib/blather/stanza/pubsub/event.rb in blather-0.4.14 vs lib/blather/stanza/pubsub/event.rb in blather-0.4.15
- old
+ new
@@ -114,9 +114,27 @@
def subscription_ids
find('//ns:header[@name="SubID"]', :ns => SHIM_NS).map do |n|
n.content
end
end
+
+ # Check if this is a subscription stanza
+ #
+ # @return [XML::Node, nil]
+ def subscription?
+ subscription_node
+ end
+
+ # Get the actual subscription node
+ #
+ # @return [Blather::XMPPNode]
+ def subscription_node
+ event_node.find_first('//ns:subscription', :ns => self.class.registered_ns)
+ end
+
+ def subscription
+ subscription_node
+ end
end # Event
end # PubSub
end # Stanza
end # Blather