Ejemplo n.º 1
0
 def getNewMessageIds(self, db):
     """
         Returns the remote IDs of any new messages on the server.
     """
     
     self.updateContacts(db)
     
     if not self.smsFile:
         return []
     
     sql = """
         SELECT ROWID FROM message
         WHERE address IS NOT NULL
             AND text IS NOT NULL
         ORDER BY ROWID;"""
     
     connection = sqlite3.connect(self.smsFile)
     
     remoteIds = sqlite.executeManyToDictionary(connection, sql)
     
     remoteIds = [row['ROWID'] for row in remoteIds]
     storedIds = [int(msg['intRemoteId']) for msg in message.getAllRemoteIds(db, 'iPhone SMS', self.account.id)]
     
     self.idsToFetch = [msg for msg in remoteIds if storedIds.count(msg) == 0]
     
     connection.close()
Ejemplo n.º 2
0
 def getNewMessageIds(self, db):
     availableIds = []
     
     for path in settings.knownIMLogPaths:
         availableIds += self.parseDirectory(path, path, [])
     storedIds = message.getAllRemoteIds(db, 'IM')
     
     storedIds = [unicode(id['strRemoteId']) for id in storedIds]
     
     self.idsToFetch = [path for path in availableIds if storedIds.count(unicode(path[1])) == 0]
Ejemplo n.º 3
0
    def getNewMessageIds(self, db):
        """
            Returns the remote IDs of any new messages on the server.
        """
        
        server = self._connect()
        serverIds = [msgId for msgId in server.getMailIds()]
        server.logout()
        
        storedIds = [int(msg['intRemoteId']) for msg in message.getAllRemoteIds(db, 'imap', self.account.id)]

        self.idsToFetch = [msg for msg in serverIds if storedIds.count(msg) == 0]