summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-11-16 12:52:07 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-16 14:26:04 +0000
commit6812be7c0da6cb39c4f6bb449e374a2c96f007bb (patch)
tree8130b665e59917ffb54083a1444d5caca855cca9
parentfe5b396b46d963cd1fa8c2e6cd9d36012edd5867 (diff)
downloadwocky-salut-0.8.tar.gz
MetaPorter: don't match sender on C2S porterssalut-0.8
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
-rw-r--r--wocky/wocky-meta-porter.c26
1 files 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),