View Single Post
Posts: 6 | Thanked: 18 times | Joined on Mar 2012 @ Germany
#3107
Hi,
first of all: thanks for the great work, devs! :-)

After installing wazapp-29082012-1330.deb, location sending seems to be broken.
If I send a location to myself, it gets the "yellow dot", but it never seems to get delivered.
If I restart Wazapp, my N9 vibrates announcing a new message, but none is displayed. Any other message I send to myself after that does not get send and stays "red".

Watching the logs gave me this:
Code:
WAXMPP: Resending 1 old messages
Conn:   Outgoing
Conn:   Incoming
Conn:   INEX
Conn:
<message type="chat" from="49151xxxxxx45@s.whatsapp.net" id="1346278905-0" t="1346278908">
<notify xmlns="urn:xmpp:whatsapp" name="fpe">
</notify>
<request xmlns="urn:xmpp:receipts">
</request>
<body>
</body>
<delay stamp="2012-08-29T22:21:48Z" xmlns="urn:xmpp:delay" from="s.whatsapp.net">
Offline Storage</delay>
<x stamp="20120829T22:21:48" xmlns="jabber:x:delay">
</x>
</message>

Conn:   INEX
WAXMPP: Resending old messages done
 {'status': 0, 'media_id': None, 'created': 1346310182032L, 'timestamp': 1346278908000.0, 'content': '', 'key': 'Key(idd="1346278905-0", from_me=False, remote_jid="49151xxxxxx45@s.whatsapp.net")', 'conversation_id': <Models.conversation.Conversation object at 0x40f8bdd0>, 'type': 0, 'id': None}
UI:     GETTING ACTIVE CONV
UI:     DONE
UI:
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QFeedbackActuator(0x15d48c8), parent's thread is QThread(0x38cba8), current thread is StanzaReader(0x28d23f8)
WAEventHandler: A new message was received: 
Traceback (most recent call last):
  File "/opt/waxmppplugin/bin/wazapp/waxmpp.py", line 977, in run
    self.parseMessage(node)
  File "/opt/waxmppplugin/bin/wazapp/waxmpp.py", line 1544, in parseMessage
    self.eventHandler.message_received(fmsg,duplicate,"chat");
  File "/opt/waxmppplugin/bin/wazapp/waxmpp.py", line 699, in message_received
    self.conn.sendMessageReceived(fmsg.key.remote_jid,mtype,fmsg.key.id);
AttributeError: 'str' object has no attribute 'remote_jid'
WAEventHandler: SEND UNAVAILABLE
(49151xxxxxx45@s.whatsapp.net in both cases is my own anonymized jid)

So apparently, the message received from the server is completely empty (<body></body>). Also, in waxmpp.py line 699 there is a problem with the "key" property. This error prevents the receipt to be sent, so the message stays yellow.

After fiddling around with the code a little bit, I realized that "key" only is still a flat string when receiving a Location from myself, otherwise it's a dict, like it is supposed to be.

I came up with this quick workaround, curing the symptoms and not the disease:
In line 698+, replace
Code:
if(fmsg.wantsReceipt):
  self.conn.sendMessageReceived(fmsg.key.remote_jid,mtype,fmsg.key.id);
with
Code:
if(fmsg.wantsReceipt):
  key = fmsg.key
  try:
    fmsg.key.remote_jid
  except AttributeError:
    key = eval(fmsg.key)
  self.conn.sendMessageReceived(key.remote_jid,mtype,key.id);
Thus being able to finally "receive" the empty, broken message (nothing gets displayed, of course), I was able to investigate further.
The actual problem seems to be, that WhatsApp always returns an error when trying to upload the location in the sendMessageWithLocation() method:

Code:
<stream:error>
<xml-not-well-formed xmlns="urn:ietf:params:xml:ns:xmpp-streams">
</xml-not-well-formed>
</stream:error>
PS:
Afterwards, I also changed line 464 in waxmpp.py from
Code:
fmsg.setData({"status":0,"content":"","type":1})
to
Code:
fmsg.setData({"status":0,"content":fmsg.content,"type":1})
so now at least I receive a message bubble saying "Location" instead of just nothing.

Thanks
fpe

Last edited by fpe; 2012-08-30 at 08:53.
 

The Following 5 Users Say Thank You to fpe For This Useful Post: