diff --git a/src/command/commands.c b/src/command/commands.c index dc0c0137..0d658576 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -3173,7 +3173,7 @@ cmd_occupants(ProfWin *window, const char *const command, gchar **args) mucwin->showjid = TRUE; mucwin_update_occupants(mucwin); } else { - mucwin_show_occupants(mucwin->roomjid); + mucwin_show_occupants(mucwin); } } else if (g_strcmp0(args[0], "hide") == 0) { if (g_strcmp0(args[1], "jid") == 0) { diff --git a/src/ui/core.c b/src/ui/core.c index b6cc5b3c..b00a703d 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -668,7 +668,7 @@ ui_show_all_room_rosters(void) if (window->type == WIN_MUC && !win_has_active_subwin(window)) { ProfMucWin *mucwin = (ProfMucWin*)window; assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); - mucwin_show_occupants(mucwin->roomjid); + mucwin_show_occupants(mucwin); } curr = g_list_next(curr); } diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 777ee461..6406b291 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -761,12 +761,14 @@ mucwin_update_occupants(ProfMucWin *mucwin) } void -mucwin_show_occupants(const char *const roomjid) +mucwin_show_occupants(ProfMucWin *mucwin) { - ProfWin *window = (ProfWin*)wins_get_muc(roomjid); - if (window && !win_has_active_subwin(window)) { + assert(mucwin != NULL); + + ProfWin *window = (ProfWin*)mucwin; + if (!win_has_active_subwin(window)) { wins_show_subwin(window); - occupantswin_occupants(roomjid); + occupantswin_occupants(mucwin->roomjid); } } diff --git a/src/ui/ui.h b/src/ui/ui.h index 469765ad..a08208b3 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -195,7 +195,7 @@ void mucwin_nick_change(ProfMucWin *mucwin, const char *const nick); void mucwin_occupant_presence(ProfMucWin *mucwin, const char *const nick, const char *const show, const char *const status); void mucwin_update_occupants(ProfMucWin *mucwin); -void mucwin_show_occupants(const char *const roomjid); +void mucwin_show_occupants(ProfMucWin *mucwin); void mucwin_hide_occupants(const char *const roomjid); void mucwin_affiliation_list_error(ProfMucWin *mucwin, const char *const affiliation, const char *const error); void mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char *const affiliation, GSList *jids); diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index c5c75c51..308f8a7e 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -232,7 +232,7 @@ void mucwin_nick_change(ProfMucWin *mucwin, const char * const nick) {} void mucwin_occupant_presence(ProfMucWin *mucwin, const char * const nick, const char * const show, const char * const status) {} void mucwin_update_occupants(ProfMucWin *mucwin) {} -void mucwin_show_occupants(const char * const roomjid) {} +void mucwin_show_occupants(ProfMucWin *mucwin) {} void mucwin_hide_occupants(const char * const roomjid) {} void ui_show_roster(void) {} void ui_hide_roster(void) {}