Beispiel #1
0
    def result(self, pyGlooxTag):
        handler = contact_note.NotesListHandler()
        notes, (count, _, last) = handler.handleTag(pyGlooxTag)
        getter = self.usersStorage.getUser
        setter = self.usersStorage.setUser
        for dbID, note in notes:
            contact = getter(dbID)
            if contact:
                contact.update(note=note)
            else:
                setter(SharedUserEntity(dbID, note=note))

        self._offset += len(notes)
        if self._offset < count:
            self._iqID = self.client().sendIQ(contact_note.NotesListQuery(CONTACT_LIMIT.NOTES_PER_PAGE, last))
        else:
            g_messengerEvents.users.onNotesListReceived()
            self._result = TASK_RESULT.REMOVE
Beispiel #2
0
 def _doRun(self, client):
     self._iqID = client.sendIQ(contact_note.NotesListQuery(CONTACT_LIMIT.NOTES_PER_PAGE))