diff options
-rw-r--r-- | src/event/server_events.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index da7a8e99..3ba51afb 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -657,27 +657,19 @@ sv_ev_muc_occupant_online(const char *const room, const char *const nick, const // presence unchanged, check for role/affiliation change } else { - if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { + ProfMucWin *mucwin = wins_get_muc(room); + if (mucwin && prefs_get_boolean(PREF_MUC_PRIVILEGES)) { // both changed if ((g_strcmp0(role, old_role) != 0) && (g_strcmp0(affiliation, old_affiliation) != 0)) { - ProfMucWin *mucwin = wins_get_muc(room); - if (mucwin) { - mucwin_occupant_role_and_affiliation_change(mucwin, nick, role, affiliation, actor, reason); - } + mucwin_occupant_role_and_affiliation_change(mucwin, nick, role, affiliation, actor, reason); // role changed } else if (g_strcmp0(role, old_role) != 0) { - ProfMucWin *mucwin = wins_get_muc(room); - if (mucwin) { - mucwin_occupant_role_change(mucwin, nick, role, actor, reason); - } + mucwin_occupant_role_change(mucwin, nick, role, actor, reason); // affiliation changed } else if (g_strcmp0(affiliation, old_affiliation) != 0) { - ProfMucWin *mucwin = wins_get_muc(room); - if (mucwin) { - mucwin_occupant_affiliation_change(mucwin, nick, affiliation, actor, reason); - } + mucwin_occupant_affiliation_change(mucwin, nick, affiliation, actor, reason); } } occupantswin_occupants(room); |