From c83d38b5fc1941e7a0d5f6bf8ba31c85fe9316a1 Mon Sep 17 00:00:00 2001 From: bahkadomos Date: Thu, 27 Apr 2023 12:25:58 +0300 Subject: [PATCH] #3007 pull request --- .../protocolentities/iq_picture_get_result.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/yowsup/layers/protocol_profiles/protocolentities/iq_picture_get_result.py b/yowsup/layers/protocol_profiles/protocolentities/iq_picture_get_result.py index 676adbb9d..a31964abc 100644 --- a/yowsup/layers/protocol_profiles/protocolentities/iq_picture_get_result.py +++ b/yowsup/layers/protocol_profiles/protocolentities/iq_picture_get_result.py @@ -10,12 +10,13 @@ class ResultGetPictureIqProtocolEntity(PictureIqProtocolEntity): ''' def __init__(self, jid, pictureData, pictureId, preview = True, _id = None): super(ResultGetPictureIqProtocolEntity, self).__init__(jid, _id, "result") - self.setResultPictureProps(pictureData, pictureId, preview) + self.setResultPictureProps(jid, pictureData, pictureId, preview) - def setResultPictureProps(self, pictureData, pictureId, preview = True): + def setResultPictureProps(self, jid , pictureData, pictureId, preview = True): self.preview = preview self.pictureData = pictureData self.pictureId = pictureId + self.jid = jid def isPreview(self): return self.preview @@ -25,6 +26,8 @@ def getPictureData(self): def getPictureId(self): return self.pictureId + def getJid(self): + return self.jid def writeToFile(self, path): with open(path, "wb") as outFile: @@ -41,5 +44,10 @@ def fromProtocolTreeNode(node): entity = PictureIqProtocolEntity.fromProtocolTreeNode(node) entity.__class__ = ResultGetPictureIqProtocolEntity pictureNode = node.getChild("picture") - entity.setResultPictureProps(pictureNode.getData(), pictureNode.getAttributeValue("id"), pictureNode.getAttributeValue("type") == "preview") + entity.setResultPictureProps( + node.getAttributeValue("from"), + pictureNode.getData(), + pictureNode.getAttributeValue("id"), + pictureNode.getAttributeValue("type") == "preview" + ) return entity \ No newline at end of file