Class | Jabber::Command::Responder |
In: |
lib/xmpp4r/command/helper/responder.rb
|
Parent: | Object |
The Responder Helper handles the low-level stuff of the Ad-hoc commands (JEP 0050).
Add a callback for <query> stanzas asking for the list of ad-hoc commands
# File lib/xmpp4r/command/helper/responder.rb, line 25 25: def add_commands_disco_callback(priority = 0, ref = nil, &block) 26: @commandsdiscocbs.add(priority, ref, block) 27: end
Add a callback for <command> stanzas asking for the execution of an ad-hoc command
# File lib/xmpp4r/command/helper/responder.rb, line 32 32: def add_commands_exec_callback(priority = 0, ref = nil, &block) 33: @commandexeccbs.add(priority, ref, block) 34: end
Handles <iq> stanzas and execute callbacks
# File lib/xmpp4r/command/helper/responder.rb, line 38 38: def iq_callback(iq) 39: if iq.type == :get 40: if iq.query.kind_of?(Jabber::Discovery::IqQueryDiscoItems) && 41: iq.query.node == "http://jabber.org/protocol/commands" 42: @commandsdiscocbs.process(iq) 43: end 44: elsif iq.type == :set && iq.command 45: @commandexeccbs.process(iq) 46: end 47: end