示例#1
0
 def message_received(self, stanza):
     if stanza.stanza_type != 'chat':
         return True
     if not stanza.body:
         logger.info("%s message: %s", stanza.from_jid, stanza.serialize())
         return True
     ReceivedMessage.received_message_from_stanza(stanza)
     return True
示例#2
0
 def message_received(self, stanza):
     if stanza.stanza_type != 'chat':
         return True
     if not stanza.body:
         logger.info("%s message: %s", stanza.from_jid, stanza.serialize())
         return True
     ReceivedMessage.received_message_from_stanza(stanza)
     return True
示例#3
0
 def loadUnreadedMessages(self):
     qs = ReceivedMessage.select().where(
         ReceivedMessage.readed == False,
         ReceivedMessage.friend == Friend.get(jid=self._toJid))
     objs = list(map(lambda item: MessageWrapper(item), qs))
     self.setAll(objs)
     with disable_auto_commit():
         for ins in qs:
             if ins.readed != True:
                 ins.readed = True
                 ins.save(update_fields=['readed'])
示例#4
0
 def loadUnreadedMessages(self):
     qs = ReceivedMessage.select().where(
         ReceivedMessage.readed == False, ReceivedMessage.friend == Friend.get(jid=self._toJid)
     )
     objs = list(map(lambda item: MessageWrapper(item), qs))
     self.setAll(objs)
     with disable_auto_commit():
         for ins in qs:
             if ins.readed != True:
                 ins.readed = True
                 ins.save(update_fields=["readed"])
示例#5
0
 def on_message_received(self, msg):
     if msg['type'] == "chat":
         ReceivedMessage.received_message_from_sleek(msg)
示例#6
0
 def on_message_received(self, msg):
     if msg["type"] == "chat":
         ReceivedMessage.received_message_from_sleek(msg)