Bug 56809

Summary: Fields are not ordered for some MIME packets
Product: papyon Reporter: Dario <dario>
Component: generalAssignee: papyon-bugs
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: git master   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch for /papyon/conversation.py to fix the typing notification problem

Description Dario 2012-11-06 14:42:25 UTC
Example of typing notification packet sent by Windows Live Messenger:
MSG 6 U 93
MIME-Version: 1.0
Content-Type: text/x-msmsgscontrol
TypingUser: dariochat@live.com



### PACKET ENDS HERE ###
Example of typing notification packet sent by emesene:
### BEGIN ###
MSG 6 U 93
TypingUser: dariochat@live.com
Content-Type: text/x-msmsgscontrol
MIME-Version: 1.0




### PACKET ENDS HERE ###
Comment 1 Youness Alaoui 2012-11-06 14:49:46 UTC
The fields are not ordered, so the order in which they appear has no importance.
Why are you opening this bug? what problem are you seeing? is there an actual behavioral bug? does it affect the user? or is this just a comment on something you noticed?
Comment 2 Dario 2012-11-06 15:21:38 UTC
The problem is that users using the latest version of Windows Live Messenger do not see the typing notification being sent by emesene.
Comment 3 Dario 2012-11-06 15:26:32 UTC
The latest revision of aMSN sends ordered fields and users of the latest Windows Live Messenger report seeing typing notifications with it. If you believe the issue is not related to the order of the fields I can investigate further.
Comment 4 Youness Alaoui 2012-11-06 15:43:59 UTC
Ok thanks, it's possible the new version uses a more strict parsing rule. Will need to patch it then in order to order the fields.
Comment 5 Riccardo (c10ud) 2012-11-06 15:45:51 UTC
could it be there's an extra \r\n?

2012/11/6  <bugzilla-daemon@freedesktop.org>:
> Comment # 3 on bug 56809 from Dario
>
> The latest revision of aMSN sends ordered fields and users of the latest
> Windows Live Messenger report seeing typing notifications with it. If you
> believe the issue is not related to the order of the fields I can
> investigate
> further.
>
> ________________________________
> You are receiving this mail because:
>
> You are the assignee for the bug.
>
>
> _______________________________________________
> papyon-bugs mailing list
> papyon-bugs@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/papyon-bugs
>
Comment 6 Dario 2012-11-06 16:13:07 UTC
Yes, there is an extra \r\n. I thought it was due to the weird ordering. Though there is no need for the fields to be ordered in a specific way I think it would be better to stick with the official protocol: http://www.hypothetic.org/docs/msn/client/messages.php.
Comment 7 Riccardo (c10ud) 2012-11-06 16:38:19 UTC
You can try tweaking emesene/e3/papylib/papyon/papyon/conversation.py:


    def send_typing_notification(self):
        content_type = "text/x-msmsgscontrol"
        body = "\r\n\r\n".encode('UTF-8')
        headers = { "TypingUser" : self._client.profile.account }
        self._send_message_ex(content_type, body, headers)


2012/11/6  <bugzilla-daemon@freedesktop.org>:
> Comment # 6 on bug 56809 from Dario
>
> Yes, there is an extra \r\n. I thought it was due to the weird ordering.
> Though
> there is no need for the fields to be ordered in a specific way I think it
> would be better to stick with the official protocol:
> http://www.hypothetic.org/docs/msn/client/messages.php.
>
> ________________________________
> You are receiving this mail because:
>
> You are the assignee for the bug.
>
>
> _______________________________________________
> papyon-bugs mailing list
> papyon-bugs@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/papyon-bugs
>
Comment 8 Dario 2012-11-06 17:11:09 UTC
Removing the extra \r\n does not fix the issue. I had already found send_typing_notification - I didn't write a patch for it myself because I had correctly suspected that a more global fix is needed to properly order the fields for every type of packet sent.
Comment 9 Dario 2012-11-06 17:32:14 UTC
Fixing the order field in a global way may prevent more problems to surface as later versions of the protocol are released.
Comment 10 Dario 2012-12-13 02:50:59 UTC
Created attachment 71418 [details] [review]
Patch for /papyon/conversation.py to fix the typing notification problem

This patch fixes the typing notification bug. The MIME-Version field is still appended at the bottom of the MIME packet though.
Comment 11 Dario 2012-12-22 02:07:25 UTC
Feel free to apply the patch upstream and set the status as RESOLVED.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.