Add better logging to onReceipt

This commit is contained in:
moyamo 2016-01-04 10:14:02 +02:00
parent 7ff39317cd
commit 5cd4442ddc

View file

@ -248,16 +248,13 @@ class Session(YowsupApp):
type, participant, offline, items])) type, participant, offline, items]))
) )
try: try:
buddy = self.buddies[_from.split('@')[0]] number = _from.split('@')[0]
#self.backend.handleBuddyChanged(self.user, buddy.number.number, self.backend.handleMessageAck(self.user, number, self.msgIDs[_id].xmppId)
# buddy.nick, buddy.groups, protocol_pb2.STATUS_ONLINE) self.msgIDs[_id].cnt = self.msgIDs[_id].cnt + 1
self.backend.handleMessageAck(self.user, buddy.number, self.msgIDs[_id].xmppId) if self.msgIDs[_id].cnt == 2:
self.msgIDs[_id].cnt = self.msgIDs[_id].cnt +1 del self.msgIDs[_id]
if self.msgIDs[_id].cnt == 2:
del self.msgIDs[_id]
except KeyError: except KeyError:
pass self.logger.error("Message %s not found. Unable to send ack", _id)
# Called by superclass # Called by superclass
def onAck(self, _id, _class, _from, timestamp): def onAck(self, _id, _class, _from, timestamp):