[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:09 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=ad9cb58

The following commit has been merged in the master branch:
commit ad9cb5859da808fd38a8f120ac25b1e96d84dc9b
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sat Feb 13 16:35:33 2010 +0000

    Keep presence and alias synced.
    
    svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=1089652
---
 kpeople/nepomuk-feeder/telepathycontact.cpp | 45 +++++++++++++++++++++++++++--
 kpeople/nepomuk-feeder/telepathycontact.h   |  4 +++
 2 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/kpeople/nepomuk-feeder/telepathycontact.cpp b/kpeople/nepomuk-feeder/telepathycontact.cpp
index 6748f6a..6f46262 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.cpp
+++ b/kpeople/nepomuk-feeder/telepathycontact.cpp
@@ -52,9 +52,18 @@ TelepathyContact::TelepathyContact(Tp::ContactPtr contact,
 
     // We need to destroy ourself if the connection goes down.
     connect(m_connection.data(),
-            SIGNAL(invalidated(Tp::DBusProxy*, const QString&, const QString&)),
+            SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
             SLOT(deleteLater()));
 
+    // Connect to signals for all properties we want to keep synced.
+    connect(m_contact.data(),
+            SIGNAL(simplePresenceChanged(QString,uint,QString)),
+            SLOT(onPresenceChanged(QString,uint,QString)));
+    connect(m_contact.data(),
+            SIGNAL(aliasChanged(QString)),
+            SLOT(onAliasChanged(QString)));
+    // FIXME: Connect to any other signals of sync-worthy properties here.
+
     // Find the Nepomuk resource for this contact, or create a new one if necessary.
     doNepomukSetup();
 }
@@ -108,9 +117,11 @@ void TelepathyContact::doNepomukSetup()
                 // Sync any properties that may have changed since last time we were online.
                 if (m_contactIMAccountResource.property(Nepomuk::Vocabulary::NCO::imNickname())
                     != m_contact->alias()) {
-                    //onNicknameChanged(m_account->nickname());
+                    onAliasChanged(m_contact->alias());
                 }
-                //onCurrentPresenceChanged(m_account->currentPresence()); // We can always assume this one needs syncing.
+                onPresenceChanged(m_contact->presenceStatus(),
+                                  m_contact->presenceType(),
+                                  m_contact->presenceMessage()); // We can always assume this one needs syncing.
                 // FIXME: What other properties do we need to sync?
 
                 break;
@@ -127,6 +138,12 @@ void TelepathyContact::doNepomukSetup()
                                                m_accountResource);
         m_contactIMAccountResource.addProperty(Nepomuk::Vocabulary::NCO::imNickname(),
                                                m_contact->alias());
+        m_contactIMAccountResource.addProperty(Nepomuk::Vocabulary::NCO::imStatus(),
+                                               m_contact->presenceStatus());
+        m_contactIMAccountResource.addProperty(Nepomuk::Vocabulary::NCO::imStatusMessage(),
+                                               m_contact->presenceMessage());
+        m_contactIMAccountResource.addProperty(Nepomuk::Vocabulary::Telepathy::statusType(),
+                                               m_contact->presenceType());
 
         m_contactPersonContactResource.addProperty(Nepomuk::Vocabulary::NCO::hasIMAccount(),
                                                    m_contactIMAccountResource);
@@ -134,6 +151,28 @@ void TelepathyContact::doNepomukSetup()
     }
 }
 
+void TelepathyContact::onAliasChanged(const QString& alias)
+{
+    // Only set properties if we have already got the contactIMAccountResource.
+    if (!m_contactIMAccountResource.uri().isEmpty()) {
+        m_contactIMAccountResource.setProperty(Nepomuk::Vocabulary::NCO::imNickname(),
+                                               alias);
+    }
+}
+
+void TelepathyContact::onPresenceChanged(const QString& status, uint type, const QString& message)
+{
+    // Only set properties if we have already got the contactIMAccountResource.
+    if (!m_contactIMAccountResource.uri().isEmpty()) {
+        m_contactIMAccountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatus(),
+                                               status);
+        m_contactIMAccountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatusMessage(),
+                                               message);
+        m_contactIMAccountResource.setProperty(Nepomuk::Vocabulary::Telepathy::statusType(),
+                                               type);
+    }
+}
+
 
 #include "telepathycontact.moc"
 
diff --git a/kpeople/nepomuk-feeder/telepathycontact.h b/kpeople/nepomuk-feeder/telepathycontact.h
index 560c156..3cb6767 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.h
+++ b/kpeople/nepomuk-feeder/telepathycontact.h
@@ -46,6 +46,10 @@ public:
                               TelepathyAccount *parent = 0);
     ~TelepathyContact();
 
+private Q_SLOTS:
+    void onAliasChanged(const QString &alias);
+    void onPresenceChanged(const QString &status, uint type, const QString &message);
+
 private:
     Q_DISABLE_COPY(TelepathyContact);
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list