Introduce equals_our_barejid()

Instead of always repeating the same pattern, introduce a helper function.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2023-12-05 12:59:51 +01:00
parent fdfe3e2ad9
commit bac24601da
9 changed files with 22 additions and 9 deletions

View File

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