mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 02:06:21 +00:00
fix(caps): Add features in caps_init to avoid redundant presence updates
Previously, features like `XMPP_FEATURE_OMEMO_DEVICELIST_NOTIFY` were added in separate init methods (e.g., `omemo_devicelist_subscribe`) via `caps_add_feature`, triggering `cl_ev_presence_send` and sending multiple "online" XMPP presence stanzas. This caused other clients to see users as appearing "online" multiple times. This change adds `STANZA_NS_MOOD_NOTIFY` and `XMPP_FEATURE_OMEMO_DEVICELIST_NOTIFY` in `caps_init`, ensuring they are in `prof_features` early. This allows `caps_add_feature` to exit early when called for these features, avoiding redundant presence updates.
This commit is contained in:
@@ -119,6 +119,14 @@ caps_init(void)
|
||||
g_hash_table_add(prof_features, strdup(STANZA_NS_LAST_MESSAGE_CORRECTION));
|
||||
}
|
||||
|
||||
if (prefs_get_boolean(PREF_MOOD)) {
|
||||
g_hash_table_add(prof_features, strdup(STANZA_NS_MOOD_NOTIFY));
|
||||
}
|
||||
|
||||
#ifdef HAVE_OMEMO
|
||||
g_hash_table_add(prof_features, strdup(XMPP_FEATURE_OMEMO_DEVICELIST_NOTIFY));
|
||||
#endif
|
||||
|
||||
my_sha1 = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user