[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:15:19 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=37f615b

The following commit has been merged in the master branch:
commit 37f615b81cfe1ad85beeec563521b9e6613526a4
Author: Weng Xuetian <wengxt at gmail.com>
Date:   Mon Sep 2 10:56:48 2013 -0400

    Fix presence when suspend during autoaway
    
    There is a possible event sequence can cause user away forever:
    1. Autoaway activate
    2. Auto suspend
    3. Resume
    4. No network
    5. autoaway deactivate
    6. Wifi connected
    7. Presence back to the one when network disconnected, which is away.
    
    now we listen connectionStatusChanged signal and set the presence on
    this signal to make sure setPresence working since there should be at
    least one contact online.
    
    REVIEW: 112442
---
 telepathy-module.cpp | 15 ++++++++++++++-
 telepathy-module.h   |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index 3e71015..93f2717 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -107,6 +107,9 @@ void TelepathyModule::onAccountManagerReady(Tp::PendingOperation* op)
     connect(m_globalPresence, SIGNAL(requestedPresenceChanged(KTp::Presence)),
             this, SLOT(onRequestedPresenceChanged(KTp::Presence)));
 
+    connect(m_globalPresence, SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
+            this, SLOT(onConnectionStatusChanged(Tp::ConnectionStatus)));
+
     m_autoAway = new AutoAway(m_globalPresence, this);
     connect(m_autoAway, SIGNAL(activate(bool)),
             this, SLOT(onPluginActivated(bool)));
@@ -159,7 +162,17 @@ void TelepathyModule::onPluginActivated(bool active)
 {
     Q_UNUSED(active);
     //a plugin has changed state, set presence to whatever a plugin thinks it should be (or restore users setting)
-    setPresence(currentPluginPresence());
+    //only do this if we are connected, otherwise this actually doesn't work since all account are offline
+    if (m_globalPresence->connectionStatus() == Tp::ConnectionStatusConnected) {
+        setPresence(currentPluginPresence());
+    }
+}
+
+void TelepathyModule::onConnectionStatusChanged(const Tp::ConnectionStatus status)
+{
+    if (status == Tp::ConnectionStatusConnected) {
+        setPresence(currentPluginPresence());
+    }
 }
 
 void TelepathyModule::setPresence(const KTp::Presence &presence)
diff --git a/telepathy-module.h b/telepathy-module.h
index ec08c6e..f39e006 100644
--- a/telepathy-module.h
+++ b/telepathy-module.h
@@ -58,6 +58,7 @@ private Q_SLOTS:
     void onAccountManagerReady(Tp::PendingOperation*);
     void onRequestedPresenceChanged(const KTp::Presence &presence);
     void onPluginActivated(bool);
+    void onConnectionStatusChanged(const Tp::ConnectionStatus status);
 
 private:
     /** Returns the presence we think we should be in. Either from the highest priority plugin, or if none are active, the last user set.*/

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list