about summary refs log tree commit diff stats
path: root/src/event/server_events.c
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2023-04-14 13:18:58 +0200
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>2023-05-10 17:51:52 +0200
commit7d9c3c1b32fcf0804a384b80a3e205b646a69b71 (patch)
treefced286664663d183b68a3f354100a19daea2742 /src/event/server_events.c
parentfaccf24c759d7bddb4d3062c7f044e0c7640ffe7 (diff)
downloadprofani-tty-7d9c3c1b32fcf0804a384b80a3e205b646a69b71.tar.gz
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 <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src/event/server_events.c')
-rw-r--r--src/event/server_events.c2
1 files changed, 1 insertions, 1 deletions
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);