set Profile Status in yowsup 2.0?
Hi, is there a way to set the Profile Status in yowsup 2.0? I haven't found a entitie for that. I think notification_status is not the same, or? If it is possible to set the Status it would be great, if someone could provide a short sample.
Thanks a lot!
Also, How to set a profile picture?
And also, How to get other Users status and profile picture. There is iq_picture which includes the string "w:profile:picture" but i dont quite understand that. Edit: I just noticed you get status updates after doing /contacts sync number,number... I didnt try but i suppose you'll also get picture updates after that.
Trying to get User's "status" and "profile picture". It would be great if someone tell me how to do this??
@kaushalsingh11 do /contacts sync then it will subscribe to them for status and profile picture updates like /presence subscribe does to presence. But it will only tell you once theyve changed picture or status not directly as you sync. And it will tell you the status message they changed to but with the profile picture it will only tell you that there is an updated picture but it wont send the picture with the notification
Any leads guys? To update status and set profile picture?
WIP
If a apply your patch, I get this exception:
...
File "yowsup/yowsup/layers/__init__.py", line 107, in send
send(entity)
File "yowsup/yowsup/layers/protocol_profiles/layer.py", line 17, in sendIq
self.toLower(entity)
File "yowsup/yowsup/layers/__init__.py", line 59, in toLower
self.__lower.send(data)
File "yowsup/yowsup/layers/logger/layer.py", line 9, in send
self.toLower(data)
File "yowsup/yowsup/layers/__init__.py", line 59, in toLower
self.__lower.send(data)
File "yowsup/yowsup/layers/coder/layer.py", line 30, in send
self.write(self.writer.protocolTreeNodeToBytes(data))
File "yowsup/yowsup/layers/coder/encoder.py", line 26, in protocolTreeNodeToBytes
self.writeInternal(node, outBytes)
File "yowsup/yowsup/layers/coder/encoder.py", line 33, in writeInternal
x = 1 + (0 if not hasattr(node, 'attributes') or node.attributes is None else len(node.attributes) * 2) + (0 if not node.hasChildren() else 1) + (0 if node.data is None else 1)
AttributeError: 'SetStatusIqProtocolEntity' object has no attribute 'hasChildren'
I've changed layers/protocol_profiles/layer.py line 17 from:
self.toLower(entity)
to:
self.entityToLower(entity)
And now message goes out:
<iq to="s.whatsapp.net" type="set" id="1">
<status>
My Status
HEX:5265323616479
</status>
</iq>
However I get 501 code:
DEBUG:yowsup.layers.logger.layer:rx:
<iq type="error" from="s.whatsapp.net" id="1">
<error text="feature-not-implemented" code="501">
</error>
</iq>
Finally I fixed it and also added yowsup-cli support with https://github.com/jlguardi/yowsup/commit/804c713135644bcaf5891cab3948861cc37b8804
jlguardi@804c713 works for me!
thank you @jlguardi !
This was solved by @tgalal in f9b88e5, right?
@aesedepece I think it is to receive the pic, not set a new one. -> @clicmd("Get profile picture for contact")
Fixed, set through SetStatusIqProtocolEntity. See this cli demo command as an example