summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/libiris/001_last_activity.patch
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/protocols/jabber/libiris/001_last_activity.patch
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/jabber/libiris/001_last_activity.patch')
-rw-r--r--kopete/protocols/jabber/libiris/001_last_activity.patch113
1 files changed, 113 insertions, 0 deletions
diff --git a/kopete/protocols/jabber/libiris/001_last_activity.patch b/kopete/protocols/jabber/libiris/001_last_activity.patch
new file mode 100644
index 00000000..24673e80
--- /dev/null
+++ b/kopete/protocols/jabber/libiris/001_last_activity.patch
@@ -0,0 +1,113 @@
+Index: iris/xmpp-im/xmpp_tasks.h
+===================================================================
+--- iris/xmpp-im/xmpp_tasks.h (revision 419672)
++++ iris/xmpp-im/xmpp_tasks.h (working copy)
+@@ -195,6 +195,29 @@
+ Private *d;
+ };
+
++ class JT_GetLastActivity : public Task
++ {
++ Q_OBJECT
++ public:
++ JT_GetLastActivity(Task *);
++ ~JT_GetLastActivity();
++
++ void get(const Jid &);
++
++ int seconds() const;
++ const QString &message() const;
++
++ void onGo();
++ bool take(const QDomElement &x);
++
++ private:
++ class Private;
++ Private *d;
++
++ QDomElement iq;
++ Jid jid;
++ };
++
+ class JT_GetServices : public Task
+ {
+ Q_OBJECT
+Index: iris/xmpp-im/xmpp_tasks.cpp
+===================================================================
+--- iris/xmpp-im/xmpp_tasks.cpp (revision 419672)
++++ iris/xmpp-im/xmpp_tasks.cpp (working copy)
+@@ -773,6 +773,74 @@
+
+
+ //----------------------------------------------------------------------------
++// JT_GetLastActivity
++//----------------------------------------------------------------------------
++class JT_GetLastActivity::Private
++{
++public:
++ Private() {}
++
++ int seconds;
++ QString message;
++};
++
++JT_GetLastActivity::JT_GetLastActivity(Task *parent)
++:Task(parent)
++{
++ d = new Private;
++}
++
++JT_GetLastActivity::~JT_GetLastActivity()
++{
++ delete d;
++}
++
++void JT_GetLastActivity::get(const Jid &j)
++{
++ jid = j;
++ iq = createIQ(doc(), "get", jid.full(), id());
++ QDomElement query = doc()->createElement("query");
++ query.setAttribute("xmlns", "jabber:iq:last");
++ iq.appendChild(query);
++}
++
++int JT_GetLastActivity::seconds() const
++{
++ return d->seconds;
++}
++
++const QString &JT_GetLastActivity::message() const
++{
++ return d->message;
++}
++
++void JT_GetLastActivity::onGo()
++{
++ send(iq);
++}
++
++bool JT_GetLastActivity::take(const QDomElement &x)
++{
++ if(!iqVerify(x, jid, id()))
++ return false;
++
++ if(x.attribute("type") == "result") {
++ QDomElement q = queryTag(x);
++
++ d->message = q.text();
++ bool ok;
++ d->seconds = q.attribute("seconds").toInt(&ok);
++
++ setSuccess(ok);
++ }
++ else {
++ setError(x);
++ }
++
++ return true;
++}
++
++//----------------------------------------------------------------------------
+ // JT_GetServices
+ //----------------------------------------------------------------------------
+ JT_GetServices::JT_GetServices(Task *parent)