bool XmppTaskMessage::HandleStanza(const txmpp::XmlElement *stanza) { if (stanza->Name() == txmpp::QN_MESSAGE) { QueueStanza(stanza); return true; } return false; }
bool XmppTaskIq::HandleStanza(const txmpp::XmlElement *stanza) { if (MatchResponseIq(stanza, txmpp::JID_EMPTY, task_id())) { QueueStanza(stanza); return true; } return false; }
bool XmppTaskPresence::HandleStanza(const txmpp::XmlElement *stanza) { if (stanza->Name() == txmpp::QN_PRESENCE) { QueueStanza(stanza); return true; } return false; }
buzz::XmppReturnStatus Send(const buzz::PresenceStatus& Status) { if (GetState() != STATE_INIT && GetState() != STATE_START) return buzz::XMPP_RETURN_BADSTATE; buzz::XmlElement* Presence = TranslateStatus(Status); QueueStanza(Presence); delete Presence; return buzz::XMPP_RETURN_OK; }
bool XmppMessageReciveTask::HandleStanza(const buzz::XmlElement *stanza) { if (stanza->Name() != buzz::QN_MESSAGE) { return false; } QueueStanza(stanza); return true; }
buzz::XmppReturnStatus SendDirected(const buzz::Jid& Jid, const buzz::PresenceStatus& Status) { if (GetState() != STATE_INIT && GetState() != STATE_START) return buzz::XMPP_RETURN_BADSTATE; buzz::XmlElement* Presence = TranslateStatus(Status); Presence->AddAttr(buzz::QN_TO, Jid.Str()); QueueStanza(Presence); delete Presence; return buzz::XMPP_RETURN_OK; }
virtual bool HandleStanza(const buzz::XmlElement* Stanza) { bool bHandled = false; // Skip all but presence stanzas if (Stanza->Name() == buzz::QN_PRESENCE) { // Queue stanza for task processing QueueStanza(Stanza); bHandled = true; } return bHandled; }
buzz::XmppReturnStatus SendProbe(const buzz::Jid& Jid) { if (GetState() != STATE_INIT && GetState() != STATE_START) return buzz::XMPP_RETURN_BADSTATE; buzz::XmlElement* Presence = new buzz::XmlElement(buzz::QN_PRESENCE); Presence->AddAttr(buzz::QN_TO, Jid.Str()); Presence->AddAttr(buzz::QN_TYPE, "probe"); QueueStanza(Presence); delete Presence; return buzz::XMPP_RETURN_OK; }
buzz::XmppReturnStatus Send(const buzz::Jid& ToJid, const FXmppMessageJingle& Message) { if (GetState() != STATE_INIT && GetState() != STATE_START) { return buzz::XMPP_RETURN_BADSTATE; } buzz::Jid ToJidFull(ToJid.node(), GetClient()->jid().domain(), ToJid.resource()); buzz::XmlElement* Stanza = MessageToStanza(ToJidFull, Message); QueueStanza(Stanza); delete Stanza; return buzz::XMPP_RETURN_OK; }
virtual bool HandleStanza(const buzz::XmlElement* Stanza) { const std::string ChatType = "chat"; bool bHandled = false; // Skip all but stanzas of message type if (Stanza->Name() == buzz::QN_MESSAGE && // Skip all but chat messages Stanza->Attr(buzz::QN_TYPE) == ChatType && // Must have a valid message body Stanza->FirstNamed(buzz::QN_BODY) != NULL) { // Queue stanza for task processing QueueStanza(Stanza); bHandled = true; } return bHandled; }