Method: Vines::User#request_subscription

Defined in:
lib/vines/user.rb

#request_subscription(jid) ⇒ Object

Update the contact’s jid on this user’s roster to signal that this user has requested the contact’s permission to receive their presence updates.



81
82
83
84
85
86
87
# File 'lib/vines/user.rb', line 81

def request_subscription(jid)
  unless contact = contact(jid)
    contact = Contact.new(:jid => jid)
    @roster << contact
  end
  contact.ask = 'subscribe' if %w[none from].include?(contact.subscription)
end