From 6812be7c0da6cb39c4f6bb449e374a2c96f007bb Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 16 Nov 2012 12:52:07 +0000 Subject: MetaPorter: don't match sender on C2S porters When someone registers a handler for stanzas from a particular contact on WockyMetaPorter, it previously would pass that contact's JID down to the relevant C2S porter. This is both unnecessary (we know who stanzas on any given C2S porter are from) and broken: iChat does not set from='' on its outgoing stanzas, so they would never match any handlers. https://bugs.freedesktop.org/show_bug.cgi?id=51527 --- wocky/wocky-meta-porter.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/wocky/wocky-meta-porter.c b/wocky/wocky-meta-porter.c index 8749bdb..492a301 100644 --- a/wocky/wocky-meta-porter.c +++ b/wocky/wocky-meta-porter.c @@ -1218,25 +1218,13 @@ register_porter_handler (StanzaHandler *handler, g_assert (g_hash_table_lookup (handler->porters, porter) == NULL); - 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); - } - + /* If handler->contact is not NULL, we know that this c2s porter is a + * connection to them, so we still don't need to tell it to match the sender. + */ + id = wocky_porter_register_handler_from_anyone_by_stanza (porter, + handler->type, handler->sub_type, + handler->priority, porter_handler_cb, handler, + handler->stanza); g_hash_table_insert (handler->porters, porter, GUINT_TO_POINTER (id)); g_object_weak_ref (G_OBJECT (porter), -- cgit v1.2.1