diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-05 16:18:22 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-05 16:18:22 +0000 |
commit | 6f832f84419698dd02876e27c042793630d0a4df (patch) | |
tree | 9db099db17810899151867dbdd440d583fcd9fa1 /kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp | |
parent | 39f99c18f862e73cb6f6a42099a017725102943e (diff) | |
download | tdenetwork-6f832f84419698dd02876e27c042793630d0a4df.tar.gz tdenetwork-6f832f84419698dd02876e27c042793630d0a4df.zip |
Commit two patches to kdenetwork from Slávek Banko:
1.) fix problem with html special chars (especially &) in messages from nowlistening plugin in kopete. Kopete::Message::RichText expects already escaped chars, but messages from nowlistening is plain text. With Kopete::Message::PlainText is message valid
2.) add pongserver, that add xep-0199 responses to kopete
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1251584 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp')
-rw-r--r-- | kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp index 9d5ee471..fcd73029 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp @@ -223,6 +223,7 @@ void Client::start(const TQString &host, const TQString &user, const TQString &p connect(pr, TQT_SIGNAL(roster(const Roster &)), TQT_SLOT(prRoster(const Roster &))); new JT_ServInfo(rootTask()); + new PongServer(rootTask()); d->active = true; } @@ -1520,3 +1521,35 @@ LiveRoster::ConstIterator LiveRoster::find(const Jid &j, bool compareRes) const } } + +//---------------------------------------------------------------------------- +// 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; +} |