From 9fb45b543baf9e24eb7f5e4b61c6dc81747917a6 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 28 Feb 2026 10:37:17 +0100 Subject: [PATCH] fix: Ignore self-presence for untracked MUC rooms Only handle self-presence for rooms we are actively managing. Earlier we blindly react to any self-presence stanza by calling 'ui_room_join'. The join could have been initiated by another client or an external Gateway. In the case of #731 this was Slack. I remember that more people reported this kind of bug in our MUC. We then would open a window and the nick would be (null) because we don't have any nickname for that room set. So only react on self-presence if we manage the MUC. Other XMPP clients do the same. Fix https://github.com/profanity-im/profanity/issues/731 --- src/xmpp/presence.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 0ea74dde..61a65da9 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -813,7 +813,12 @@ _muc_user_self_handler(xmpp_stanza_t* stanza) affiliation = xmpp_stanza_get_attribute(item, "affiliation"); } } - sv_ev_muc_self_online(room, nick, config_required, role, affiliation, actor, reason, jid, show_str, status_str); + + if (muc_active(room)) { + sv_ev_muc_self_online(room, nick, config_required, role, affiliation, actor, reason, jid, show_str, status_str); + } else { + log_debug("presence: self-presence received for untracked room: %s", room); + } } }