Method: Jabber::Roster::Helper::RosterItem#subscribe

Defined in:
lib/xmpp4r/roster/helper/roster.rb

#subscribeObject

Send subscription request to the user

The block given to Jabber::Roster::Roster#add_update_callback will be called, carrying the RosterItem with ask=“subscribe”

This function returns immediately after sending the subscription request and will not wait of approval or declination as it may take months for the contact to decide. ;-)



481
482
483
484
# File 'lib/xmpp4r/roster/helper/roster.rb', line 481

def subscribe
  pres = Presence.new.set_type(:subscribe).set_to(jid.strip)
  @stream.send(pres)
end