Class | Jabber::XMPPStanza |
In: |
lib/xmpp4r/xmppstanza.rb
|
Parent: | XMPPElement |
root class of all Jabber XML elements
Compose a response by doing the following:
Attention: Be careful when answering to stanzas with type == :error - answering to an error may generate another error on the other side, which could be leading to a ping-pong effect quickly!
xmppstanza: | [XMPPStanza] source |
import: | [true or false] Copy attributes and children of source |
result: | [XMPPStanza] answer stanza |
# File lib/xmpp4r/xmppstanza.rb, line 30 30: def XMPPStanza.answer(xmppstanza, import=true) 31: x = xmppstanza.class::new 32: if import 33: x.import(xmppstanza) 34: end 35: x.from = xmppstanza.to 36: x.to = xmppstanza.from 37: x.id = xmppstanza.id 38: x 39: end
Compose a response of this XMPPStanza (see XMPPStanza.answer)
result: | [XMPPStanza] New constructed stanza |
# File lib/xmpp4r/xmppstanza.rb, line 51 51: def answer(import=true) 52: XMPPStanza.answer(self, import) 53: end