Adding some logging
authorEd Page <eopage@byu.net>
Wed, 23 Jun 2010 00:51:05 +0000 (19:51 -0500)
committerEd Page <eopage@byu.net>
Wed, 23 Jun 2010 00:51:05 +0000 (19:51 -0500)
src/autogv.py
src/channel/text.py

index 6c7f3cc..fee55f4 100644 (file)
@@ -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)
index eb3478a..9aff9f2 100644 (file)
@@ -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: