mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Fix devicelist notification handler
devicelist handler should be kept after trigger
This commit is contained in:
parent
898302243e
commit
65b3f82c5f
@ -142,7 +142,6 @@ _message_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *con
|
||||
if (handler) {
|
||||
int keep = handler->func(stanza, handler->userdata);
|
||||
if (!keep) {
|
||||
free(handler);
|
||||
g_hash_table_remove(pubsub_event_handlers, node);
|
||||
}
|
||||
}
|
||||
@ -176,7 +175,7 @@ message_handlers_init(void)
|
||||
g_hash_table_destroy(pubsub_event_handlers);
|
||||
}
|
||||
|
||||
pubsub_event_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL);
|
||||
pubsub_event_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -337,19 +337,19 @@ _omemo_receive_devicelist(xmpp_stanza_t *const stanza, void *const userdata)
|
||||
}
|
||||
|
||||
if (!root) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *items = xmpp_stanza_get_child_by_name(root, "items");
|
||||
if (!items) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *item = xmpp_stanza_get_child_by_name(items, "item");
|
||||
if (item) {
|
||||
xmpp_stanza_t *list = xmpp_stanza_get_child_by_ns(item, STANZA_NS_OMEMO);
|
||||
if (!list) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *device;
|
||||
@ -360,7 +360,7 @@ _omemo_receive_devicelist(xmpp_stanza_t *const stanza, void *const userdata)
|
||||
}
|
||||
omemo_set_device_list(from, device_list);
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user