From 7d9c3c1b32fcf0804a384b80a3e205b646a69b71 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Apr 2023 13:18:58 +0200 Subject: [PATCH] fix "window `NULL` issue" (hopefully) There were multiple reports where after a reconnect the window of the MUC that was last opened, was empty. `muc_join()` creates an instance of a MUC, `presence_join_room()` works with this instance. Therefore the instance has to exist before working on it. I'm not sure if this really fixes the issue, but at least it didn't happen anymore after I applied this modification. I can't remember how I stumbled over this, either while looking at debug logs or while looking at Valgrind output while a reconnect happened, but something went wrong. Then I came to the conclusion that this may fix the issue and for now it did ... maybe it comes back, then my RCA was wrong. Signed-off-by: Steffen Jaeckel --- src/event/server_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/server_events.c b/src/event/server_events.c index 0f6df2ac..89eefef6 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -1332,8 +1332,8 @@ sv_ev_bookmark_autojoin(Bookmark* bookmark) log_debug("Autojoin %s with nick=%s", bookmark->barejid, nick); if (!muc_active(bookmark->barejid)) { - presence_join_room(bookmark->barejid, nick, bookmark->password); muc_join(bookmark->barejid, nick, bookmark->password, TRUE); + presence_join_room(bookmark->barejid, nick, bookmark->password); iq_room_affiliation_list(bookmark->barejid, "member", false); iq_room_affiliation_list(bookmark->barejid, "admin", false); iq_room_affiliation_list(bookmark->barejid, "owner", false);