Sha256: 7b665bf9267f0adacd7af0df44af26935bdd04684106bd593daf4b1e52731bb0
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
# encoding: UTF-8 module Vines class Stanza class Presence class Subscribe < Presence register "/presence[@type='subscribe']" def process stamp_from inbound? ? process_inbound : process_outbound end def process_outbound to = stamp_to stream.user.request_subscription(to) storage.save_user(stream.user) stream.update_user_streams(stream.user) local? ? process_inbound : route send_roster_push(to) end def process_inbound to = stamp_to follower = storage(to.domain).find_user(to) if follower.nil? auto_reply_to_subscription_request(to, 'unsubscribed') elsif follower.subscribed_from?(stream.user.jid) auto_reply_to_subscription_request(to, 'subscribed') else recipients = stream.available_resources(to) if recipients.empty? # TODO store subscription request per RFC 6121 3.1.3 #4 else broadcast_to_available_resources([@node], to) end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lygneo-vines-0.1.5 | lib/vines/stanza/presence/subscribe.rb |
lygneo-vines-0.1.1 | lib/vines/stanza/presence/subscribe.rb |