From f0abed7681c0040fd983ade9ee3c9946226d9efd Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 22 Jun 2010 19:51:05 -0500 Subject: [PATCH] Adding some logging --- src/autogv.py | 2 ++ src/channel/text.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/autogv.py b/src/autogv.py index 6c7f3cc..fee55f4 100644 --- a/src/autogv.py +++ b/src/autogv.py @@ -65,6 +65,7 @@ class NewGVConversations(object): # Just let the TextChannel decide whether it should be reported to the user or not props = self._connRef().generate_props(telepathy.CHANNEL_TYPE_TEXT, h, False) if self._connRef()._channel_manager.channel_exists(props): + _moduleLogger.debug("Chat box already open for texting conversation with %s" % phoneNumber) continue # Maemo 4.1's RTComm opens a window for a chat regardless if a @@ -75,6 +76,7 @@ class NewGVConversations(object): newConversations = gvoice.conversations.filter_out_self(newConversations) newConversations = list(newConversations) if not newConversations: + _moduleLogger.debug("Not opening chat box for %s, all new messages are either read or from yourself" % phoneNumber) continue chan = self._connRef()._channel_manager.channel_for_props(props, signal=True) diff --git a/src/channel/text.py b/src/channel/text.py index eb3478a..9aff9f2 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -127,7 +127,21 @@ class TextChannel(tp.ChannelTypeText): # before the last one sent because that creates a race condition of two # people sending at about the same time, which happens quite a bit newConversations = gvoice.conversations.filter_out_self(newConversations) + newConversations = list(newConversations) + if not newConversations: + _moduleLogger.debug( + "New messages for %r are from yourself" % (self._contactKey, ) + ) + return + newConversations = self._filter_out_reported(newConversations) + newConversations = list(newConversations) + if not newConversations: + _moduleLogger.debug( + "New messages for %r have already been reported" % (self._contactKey, ) + ) + return + newConversations = gvoice.conversations.filter_out_read(newConversations) newConversations = list(newConversations) if not newConversations: -- 1.7.9.5