Bug 51527 - Messages from iChat are silently ignored
Summary: Messages from iChat are silently ignored
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: salut (show other bugs)
Version: 0.8
Hardware: Other All
: medium major
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-06-28 10:03 UTC by Will Thompson
Modified: 2019-12-03 20:16 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Will Thompson 2012-06-28 10:03:04 UTC
Messages from iChat are completely ignored by Salut. I suspect this is because they have no from='' attribute. In the following log, 'wjt@queeg' is using Salut, and 'wjt@bael' is using iChat.

First I send a message from Salut to iChat, and it comes out at the other end just fine:

(telepathy-salut:31900): wocky-DEBUG: _write_node_tree: Serializing tree:
* message xmlns='jabber:client' from='wjt@queeg' to='wjt@bael' type='chat'
    * body
        "Here is a message from Salut to iChat"
    * html xmlns='http://jabber.org/protocol/xhtml-im'
        * body xmlns='http://www.w3.org/1999/xhtml'
            "Here is a message from Salut to iChat"
(telepathy-salut:31900): wocky-DEBUG: Writing xml: <message from="wjt@queeg" to="wjt@bael" type="chat"><body>Here is a message from Salut to iChat</body><html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml">Here is a message from Salut to iChat</body></html></message>

I start typing in iChat, and no notification appears:

(telepathy-salut:31900): wocky-DEBUG: Parsing chunk: <message to="wjt@queeg"><body> </body>
<html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml"  style="background-color:#fc86ca;color:#000000;"> </body></html><x xmlns="jabber:x:event"><composing/><id></id>
</x>
<composing xmlns="http://jabber.org/protocol/chatstates"/></message>

(telepathy-salut:31900): wocky-DEBUG: _end_element_ns: Received stanza
* message xmlns='jabber:client' to='wjt@queeg'
    "

"
    * body
        " "
    * html xmlns='http://jabber.org/protocol/xhtml-im'
        * body xmlns='http://www.w3.org/1999/xhtml' style='background-color:#fc86ca;color:#000000;'
            " "
    * x xmlns='jabber:x:event'
        "
"
        * composing
        * id
    * composing xmlns='http://jabber.org/protocol/chatstates'
(telepathy-salut:31900): wocky-DEBUG: handle_stanza: wocky-c2s-porter.c:1023: Stanza not handled

And then I hit enter in iChat. The message doesn't show up in Empathy:

(telepathy-salut:31900): wocky-DEBUG: Parsing chunk: <message to="wjt@queeg" type="chat"><body>Here is a message from iChat to Salut</body>
<html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml"  style="background-color:#fc86ca;color:#000000;"><span style="font-family: 'Helvetica';font-size: 12px;">Here is a message from iChat to Salut</span></body></html><x xmlns="jabber:x:event"><composing/></x>
</message>

(telepathy-salut:31900): wocky-DEBUG: _end_element_ns: Received stanza
* message xmlns='jabber:client' to='wjt@queeg' type='chat'
    "

"
    * body
        "Here is a message from iChat to Salut"
    * html xmlns='http://jabber.org/protocol/xhtml-im'
        * body xmlns='http://www.w3.org/1999/xhtml' style='background-color:#fc86ca;color:#000000;'
            * span style='font-family: 'Helvetica';font-size: 12px;'
                "Here is a message from iChat to Salut"
    * x xmlns='jabber:x:event'
        * composing
(telepathy-salut:31900): wocky-DEBUG: handle_stanza: wocky-c2s-porter.c:1023: Stanza not handled

Salut-to-Salut works. The main difference I see is that iChat does not include from='' in the <message/>. WockyMetaPorter does this:

  if (handler->contact != NULL)
    {
      gchar *jid = wocky_contact_dup_jid (handler->contact);

      id = wocky_porter_register_handler_from_by_stanza (porter,
          handler->type, handler->sub_type, jid,
          handler->priority, porter_handler_cb, handler,
          handler->stanza);

      g_free (jid);
    }
  else
    {
      id = wocky_porter_register_handler_from_anyone_by_stanza (porter,
          handler->type, handler->sub_type,
          handler->priority, porter_handler_cb, handler,
          handler->stanza);
    }

I guess that, really, we know that any stanzas coming in are from the contact we think they are, so perhaps the MetaPorter should always use from_anyone() and then forcibly replace from=''?
Comment 1 Will Thompson 2012-11-16 12:59:58 UTC
(In reply to comment #0)
> I guess that, really, we know that any stanzas coming in are from the
> contact we think they are, so perhaps the MetaPorter should always use
> from_anyone() and then forcibly replace from=''?

Sure enough, a patch to make register_porter_handler() always use wocky_porter_register_handler_from_anyone_by_stanza() does fix the problem. But I don't understand why tests/twisted/avahi/ichat-incoming-msg.py doesn't expose this bug. Investigating further…
Comment 2 Will Thompson 2012-11-16 14:09:47 UTC
Haha, the first stanza sent by a contact, before the channel was open, worked fine. But once the channel is open, it uses register_handler_from() and hence the stanza got ignored. ♥

The fix is in Wocky: http://cgit.collabora.com/git/user/wjt/wocky/log/?h=51527-metaporter-sender-matching
The test case is in Salut: http://cgit.collabora.com/git/user/wjt/telepathy-salut/log/?h=51527-iChat-messages-ignored
Comment 3 Will Thompson 2012-11-16 16:50:30 UTC
The fix for this is merged to wocky <http://cgit.collabora.com/git/user/wjt/wocky/commit/?id=6812be7c> and released in telepathy-salut 0.8.1.

http://cgit.collabora.com/git/user/wjt/wocky/log/?h=metaporter-cleanup is some remaining cleanup of the MetaPorter.
http://cgit.collabora.com/git/user/wjt/telepathy-salut/log/?h=51527-iChat-messages-ignored-test is the test for this bug.
Comment 4 GitLab Migration User 2019-12-03 20:16:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-salut/issues/39.


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.