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

@@ -200,9 +200,8 @@ roster_set_handler(xmpp_stanza_t* const stanza)
}
// if from attribute exists and it is not current users barejid, ignore push
auto_char char* mybarejid = connection_get_barejid();
const char* from = xmpp_stanza_get_from(stanza);
if (from && (strcmp(from, mybarejid) != 0)) {
if (from && (strcmp(from, connection_get_barejid()) != 0)) {
log_warning("Received alleged roster push from: %s", from);
return;
}