1

I'm using yowsup, and need to figure out a problem that I haven't faced before. I already received messages via the onMessage event, but now it doesn't work. On debug, I got InvalidMessage or KeyId for xxxxx, going to send a retry.

I tried to delete axolotl.db, but nothing.

This is my layer.py:

class ReadLayer(YowInterfaceLayer):
@EventCallback(YowNetworkLayer.EVENT_STATE_CONNECTED)
def onConnected(self, yowLayerEvent):
    print "----- CONECTADO ----- \n"

@ProtocolEntityCallback("message")
def onMessage(self, messageProtocolEntity):
    if messageProtocolEntity.getType() == 'text':
        frm = messageProtocolEntity.getFrom()
        body = messageProtocolEntity.getBody()

        print ("- Mensagem de %s \n>>> %s \n\n" % (frm, body))

    if messageProtocolEntity.getType()  == 'media':
        if messageProtocolEntity.getMediaType() == 'image':
            frm = messageProtocolEntity.getFrom()
            url = messageProtocolEntity.url

            print ("- Imagem de %s \n>>> %s\n\n" % (frm, url))

    self.toLower(messageProtocolEntity.ack())
    self.toLower(messageProtocolEntity.ack(True))

@ProtocolEntityCallback("receipt")
def onReceipt(self, entity):
    self.toLower(entity.ack())
Adil B
  • 14,635
  • 11
  • 60
  • 78

0 Answers0