summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp')
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp
index 4e4c96d1..89d66796 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp
@@ -2118,3 +2118,34 @@ TQDomElement JT_PrivateStorage::element( )
return d->elem;
}
+//----------------------------------------------------------------------------
+// PongServer
+//----------------------------------------------------------------------------
+/**
+ * \class PongServer
+ * \brief Answers XMPP Pings
+ */
+
+PongServer::PongServer(Task *parent)
+:Task(parent)
+{
+}
+
+PongServer::~PongServer()
+{
+}
+
+bool PongServer::take(const TQDomElement &e)
+{
+ if (e.tagName() != "iq" || e.attribute("type") != "get")
+ return false;
+
+ bool found = false;
+ TQDomElement ping = findSubTag(e, "ping", &found);
+ if (found && ping.attribute("xmlns") == "urn:xmpp:ping") {
+ TQDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id"));
+ send(iq);
+ return true;
+ }
+ return false;
+}