removed timestamp parameter to sendReceipt (fixes #70)
This commit is contained in:
parent
ccd866c72f
commit
23bc90adf6
14
session.py
14
session.py
|
@ -213,7 +213,7 @@ class Session(YowsupApp):
|
|||
def sendReadReceipts(self, buddy):
|
||||
for _id, _from, participant, t in self.recvMsgIDs:
|
||||
if _from.split('@')[0] == buddy:
|
||||
self.sendReceipt(_id, _from, 'read', participant, t)
|
||||
self.sendReceipt(_id, _from, 'read', participant)
|
||||
self.recvMsgIDs.remove((_id, _from, participant, t))
|
||||
self.logger.debug("Send read receipt to %s (ID: %s)", _from, _id)
|
||||
|
||||
|
@ -282,7 +282,7 @@ class Session(YowsupApp):
|
|||
offline, retry, body):
|
||||
buddy = _from.split('@')[0]
|
||||
messageContent = utils.softToUni(body)
|
||||
self.sendReceipt(_id, _from, None, participant, timestamp)
|
||||
self.sendReceipt(_id, _from, None, participant)
|
||||
self.recvMsgIDs.append((_id, _from, participant, timestamp))
|
||||
self.logger.info("Message received from %s to %s: %s (at ts=%s)" %
|
||||
(buddy, self.legacyName, messageContent, timestamp))
|
||||
|
@ -335,7 +335,7 @@ class Session(YowsupApp):
|
|||
else:
|
||||
self.sendMessageToXMPP(buddy, url, image.timestamp)
|
||||
self.sendMessageToXMPP(buddy, image.caption, image.timestamp)
|
||||
self.sendReceipt(image._id, image._from, None, image.participant, image.timestamp)
|
||||
self.sendReceipt(image._id, image._from, None, image.participant)
|
||||
self.recvMsgIDs.append((image._id, image._from, image.participant, image.timestamp))
|
||||
|
||||
|
||||
|
@ -354,7 +354,7 @@ class Session(YowsupApp):
|
|||
self.sendGroupMessageToXMPP(buddy, partname, message, audio.timestamp)
|
||||
else:
|
||||
self.sendMessageToXMPP(buddy, message, audio.timestamp)
|
||||
self.sendReceipt(audio._id, audio._from, None, audio.participant, audio.timestamp)
|
||||
self.sendReceipt(audio._id, audio._from, None, audio.participant)
|
||||
self.recvMsgIDs.append((audio._id, audio._from, audio.participant, audio.timestamp))
|
||||
|
||||
|
||||
|
@ -374,7 +374,7 @@ class Session(YowsupApp):
|
|||
self.sendGroupMessageToXMPP(buddy, partname, message, video.timestamp)
|
||||
else:
|
||||
self.sendMessageToXMPP(buddy, message, video.timestamp)
|
||||
self.sendReceipt(video._id, video._from, None, video.participant, video.timestamp)
|
||||
self.sendReceipt(video._id, video._from, None, video.participant)
|
||||
self.recvMsgIDs.append((video._id, video._from, video.participant, video.timestamp))
|
||||
|
||||
|
||||
|
@ -403,7 +403,7 @@ class Session(YowsupApp):
|
|||
if url is not None:
|
||||
self.sendMessageToXMPP(buddy, url, location.timestamp)
|
||||
self.sendMessageToXMPP(buddy, latlong, location.timestamp)
|
||||
self.sendReceipt(location._id, location._from, None, location.participant, location.timestamp)
|
||||
self.sendReceipt(location._id, location._from, None, location.participant)
|
||||
self.recvMsgIDs.append((location._id, location._from, location.participant, location.timestamp))
|
||||
|
||||
|
||||
|
@ -426,7 +426,7 @@ class Session(YowsupApp):
|
|||
self.sendMessageToXMPP(buddy, message, timestamp)
|
||||
# self.sendMessageToXMPP(buddy, card_data)
|
||||
#self.transferFile(buddy, str(name), card_data)
|
||||
self.sendReceipt(_id, _from, None, participant, timestamp)
|
||||
self.sendReceipt(_id, _from, None, participant)
|
||||
self.recvMsgIDs.append((_id, _from, participant, timestamp))
|
||||
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ class YowsupApp(object):
|
|||
"""
|
||||
self.stack.broadcastEvent(YowLayerEvent(YowNetworkLayer.EVENT_STATE_DISCONNECT))
|
||||
|
||||
def sendReceipt(self, _id, _from, read, participant, t):
|
||||
def sendReceipt(self, _id, _from, read, participant):
|
||||
"""
|
||||
Send a receipt (delivered: double-tick, read: blue-ticks)
|
||||
|
||||
|
@ -139,10 +139,9 @@ class YowsupApp(object):
|
|||
- _from: jid of person who sent the message
|
||||
- read: ('read' or None) None is just delivered, 'read' is read
|
||||
- participant
|
||||
- t: The time the original message was sent.
|
||||
"""
|
||||
self.logger.debug(u'Sending receipt to whatsapp: %s', [_id, _from, read, participant, t])
|
||||
receipt = OutgoingReceiptProtocolEntity(_id, _from, read, participant, t=t)
|
||||
self.logger.debug(u'Sending receipt to whatsapp: %s', [_id, _from, read, participant])
|
||||
receipt = OutgoingReceiptProtocolEntity(_id, _from, read, participant)
|
||||
self.sendEntity(receipt)
|
||||
|
||||
def downloadMedia(self, url, onSuccess = None, onFailure = None):
|
||||
|
|
Loading…
Reference in a new issue