lib/blather/roster_item.rb in blather-0.7.0 vs lib/blather/roster_item.rb in blather-0.7.1
- old
+ new
@@ -111,14 +111,14 @@
# Translate the RosterItem into a proper stanza that can be sent over the
# stream
#
# @return [Blather::Stanza::Iq::Roster]
def to_stanza(type = nil)
- r = Stanza::Iq::Roster.new type
- n = Stanza::Iq::Roster::RosterItem.new jid, name, subscription, ask
- r.query << n
- n.groups = groups
- r
+ Stanza::Iq::Roster.new type, to_node
+ end
+
+ def to_node
+ Stanza::Iq::Roster::RosterItem.new jid, name, subscription, ask, groups
end
# Compare two RosterItems by their JID
#
# @param [Blather::JID] other the JID to compare against