[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:25:27 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=92f773a

The following commit has been merged in the master branch:
commit 92f773a6ec92e97595b5173cc8ca039d3bde998d
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Tue Aug 4 17:22:46 2015 +0200

    Delay reconnecting to previously opened channels
    
    This mostly works around a gabble bug which returns incomplete data when
    reopening a channel immediately after gabble connects
    
    BUG: 318180
    FIXED-IN: 15.08.0
---
 app/chat-tab.cpp | 28 ++++++++++++++++++----------
 app/chat-tab.h   |  1 +
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/app/chat-tab.cpp b/app/chat-tab.cpp
index 9f2d0f4..bf18945 100644
--- a/app/chat-tab.cpp
+++ b/app/chat-tab.cpp
@@ -85,21 +85,29 @@ void ChatTab::onConnectionStatusChanged(Tp::ConnectionStatus status)
 {
     // request a new text channel for the chat
 
+    if (status == Tp::ConnectionStatusConnected) {
+        // Delay the channels reopening for a little bit as it can result
+        // in displaying not accurate data received from gabble
+        // see https://bugs.kde.org/show_bug.cgi?id=318180 for details
+        QTimer::singleShot(2500, this, &ChatTab::setupChannelsTimeout);
+    }
+}
+
+void ChatTab::setupChannelsTimeout()
+{
     Tp::ChannelRequestHints hints;
     hints.setHint(QLatin1String("org.kde.telepathy"),QLatin1String("suppressWindowRaise"), QVariant(true));
 
-    if (status == Tp::ConnectionStatusConnected) {
-        if (textChannel()->targetHandleType() == Tp::HandleTypeContact) {
-            account()->ensureTextChat(textChannel()->targetId(),
+    if (textChannel()->targetHandleType() == Tp::HandleTypeContact) {
+        account()->ensureTextChat(textChannel()->targetId(),
+                                  QDateTime::currentDateTime(),
+                                  QLatin1String(KTP_TEXTUI_CLIENT_PATH),
+                                  hints);
+    } else if (textChannel()->targetHandleType() == Tp::HandleTypeRoom) {
+
+        account()->ensureTextChatroom(textChannel()->targetId(),
                                       QDateTime::currentDateTime(),
                                       QLatin1String(KTP_TEXTUI_CLIENT_PATH),
                                       hints);
-        } else if (textChannel()->targetHandleType() == Tp::HandleTypeRoom) {
-
-            account()->ensureTextChatroom(textChannel()->targetId(),
-                                          QDateTime::currentDateTime(),
-                                          QLatin1String(KTP_TEXTUI_CLIENT_PATH),
-                                          hints);
-        }
     }
 }
diff --git a/app/chat-tab.h b/app/chat-tab.h
index 0132d53..92bf8fe 100644
--- a/app/chat-tab.h
+++ b/app/chat-tab.h
@@ -56,6 +56,7 @@ private Q_SLOTS:
     /** connect account's connection status.
      * This re-enables open chats if user goes offline and then back online */
     void onConnectionStatusChanged(Tp::ConnectionStatus);
+    void setupChannelsTimeout();
 
 private:
     /** pointer to chat window the tab is nested in */

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list