add connection_get_jid()

Use a singleton `Jid` inside the connection instead of always re-creating
a `Jid` from the same string.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2023-11-14 14:53:49 +01:00
parent b18b6cbd29
commit 847a86de50
17 changed files with 88 additions and 101 deletions

View File

@@ -882,8 +882,7 @@ muc_members_add(const char* const room, const char* const jid)
if (g_hash_table_insert(chat_room->members, strdup(jid), NULL)) {
#ifdef HAVE_OMEMO
if (chat_room->anonymity_type == MUC_ANONYMITY_TYPE_NONANONYMOUS) {
auto_char char* our_barejid = connection_get_barejid();
if (strcmp(jid, our_barejid) != 0) {
if (strcmp(jid, connection_get_barejid()) != 0) {
omemo_start_session(jid);
}
}