Making phone numbers as consistent as possible so user started conversations don...
[theonering] / src / gvoice / conversations.py
index 8baf8b8..6e08112 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/python
 
-# @bug Its inconsistent as to whether messages from contacts come as from the
-# contact or just a raw number.  It seems GV is inconsistent about populating the contact id, so we might have to pull from the addressbook
 # @bug False positives on startup.  Luckily the object path for the channel is
 # unique, so can use that to cache some of the data out to file
 
+from __future__ import with_statement
+
 import logging
 
 import util.coroutines as coroutines
@@ -32,7 +32,7 @@ class Conversations(object):
                conversations = list(self._get_raw_conversations())
                conversations.sort()
                for conversation in conversations:
-                       key = conversation.contactId, util_misc.strip_number(conversation.number)
+                       key = conversation.contactId, util_misc.normalize_number(conversation.number)
                        try:
                                mergedConversations = self._conversations[key]
                        except KeyError: