Class: Vines::Stanza::Presence::Subscribed
- Inherits:
-
Vines::Stanza::Presence
- Object
- Vines::Stanza
- Vines::Stanza::Presence
- Vines::Stanza::Presence::Subscribed
- Defined in:
- lib/vines/stanza/presence/subscribed.rb
Constant Summary
Constants inherited from Vines::Stanza::Presence
Constants inherited from Vines::Stanza
Instance Attribute Summary
Attributes inherited from Vines::Stanza
Instance Method Summary collapse
Methods inherited from Vines::Stanza::Presence
#inbound?, #inbound_broadcast_presence, #outbound?, #outbound_broadcast_presence
Methods inherited from Vines::Stanza
#broadcast, from_node, #initialize, #local?, #local_jid?, #method_missing, register, #route, #router, #send_unavailable, #storage, #to_pubsub_domain?, #unavailable, #validate_from, #validate_to
Constructor Details
This class inherits a constructor from Vines::Stanza
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vines::Stanza
Instance Method Details
#process ⇒ Object
9 10 11 12 |
# File 'lib/vines/stanza/presence/subscribed.rb', line 9 def process stamp_from inbound? ? process_inbound : process_outbound end |
#process_inbound ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vines/stanza/presence/subscribed.rb', line 24 def process_inbound to = stamp_to user = storage(to.domain).find_user(to) contact = user.contact(stream.user.jid) if user return unless contact && contact.can_subscribe? contact.subscribe_to storage(to.domain).save_user(user) stream.update_user_streams(user) broadcast_subscription_change(contact) end |
#process_outbound ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/vines/stanza/presence/subscribed.rb', line 14 def process_outbound to = stamp_to stream.user.add_subscription_from(to) storage.save_user(stream.user) stream.update_user_streams(stream.user) local? ? process_inbound : route send_roster_push(to) send_known_presence(to) end |