[telepathy-qt4/master] TextChannel: Make sure contactsForHandles is not called when not needed.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Mon Nov 2 09:26:12 PST 2009


---
 TelepathyQt4/text-channel.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/text-channel.cpp b/TelepathyQt4/text-channel.cpp
index 2d331be..f682ae8 100644
--- a/TelepathyQt4/text-channel.cpp
+++ b/TelepathyQt4/text-channel.cpp
@@ -434,6 +434,10 @@ void TextChannel::Private::processMessageQueue()
         }
     }
 
+    if (contactsRequired.isEmpty()) {
+        return;
+    }
+
     parent->connect(parent->connection()->contactManager()->contactsForHandles(
                 contactsRequired.toList()),
             SIGNAL(finished(Tp::PendingOperation *)),
@@ -472,6 +476,10 @@ void TextChannel::Private::processChatStateQueue()
         }
     }
 
+    if (contactsRequired.isEmpty()) {
+        return;
+    }
+
     parent->connect(parent->connection()->contactManager()->contactsForHandles(
                 contactsRequired.toList()),
             SIGNAL(finished(Tp::PendingOperation *)),
-- 
1.5.6.5




More information about the telepathy-commits mailing list