diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/event/server_events.c | 5 | ||||
-rw-r--r-- | src/ui/mucwin.c | 6 | ||||
-rw-r--r-- | src/ui/ui.h | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index 6254d725..0d044704 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -671,7 +671,10 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const // affiliation changed } else if (g_strcmp0(affiliation, old_affiliation) != 0) { - mucwin_occupant_affiliation_change(room, nick, affiliation, actor, reason); + ProfMucWin *mucwin = wins_get_muc(room); + if (mucwin) { + mucwin_occupant_affiliation_change(mucwin, nick, affiliation, actor, reason); + } } } occupantswin_occupants(room); diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 692d884a..9abf86d6 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -109,10 +109,12 @@ mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, const ch } void -mucwin_occupant_affiliation_change(const char *const roomjid, const char *const nick, const char *const affiliation, +mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, const char *const affiliation, const char *const actor, const char *const reason) { - ProfWin *window = (ProfWin*)wins_get_muc(roomjid); + assert(mucwin != NULL); + + ProfWin *window = (ProfWin*)mucwin; win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's affiliation has been changed to: %s", nick, affiliation); if (actor) { win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); diff --git a/src/ui/ui.h b/src/ui/ui.h index 5409fa8f..263b4d91 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -168,7 +168,7 @@ void mucwin_role_and_affiliation_change(ProfMucWin *mucwin, const char *const ro const char *const affiliation, const char *const actor, const char *const reason); void mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, const char *const role, const char *const actor, const char *const reason); -void mucwin_occupant_affiliation_change(const char *const roomjid, const char *const nick, +void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, const char *const affiliation, const char *const actor, const char *const reason); void mucwin_occupant_role_and_affiliation_change(const char *const roomjid, const char *const nick, const char *const role, const char *const affiliation, const char *const actor, const char *const reason); |