about summary refs log tree commit diff stats
path: root/src/event/server_events.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-01 23:10:07 +0000
committerJames Booth <boothj5@gmail.com>2015-11-01 23:10:07 +0000
commit22cd5b433f90446066de0f63fbefe89bda1b0abb (patch)
tree1dd96cfbd51541cb3f92b4b7d914625e9530039a /src/event/server_events.c
parent6ea9314f982ae5935b8428116b06552ef8a2b996 (diff)
downloadprofani-tty-22cd5b433f90446066de0f63fbefe89bda1b0abb.tar.gz
Tidy sv_ev_muc_self_online
Diffstat (limited to 'src/event/server_events.c')
-rw-r--r--src/event/server_events.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index acfa0c4f..3982f14c 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -585,27 +585,19 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
 
     // check for change in role/affiliation
     } 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_role_and_affiliation_change(mucwin, role, affiliation, actor, reason);
-                }
+                mucwin_role_and_affiliation_change(mucwin, role, affiliation, actor, reason);
 
             // role changed
             } else if (g_strcmp0(role, old_role) != 0) {
-                ProfMucWin *mucwin = wins_get_muc(room);
-                if (mucwin) {
-                    mucwin_role_change(mucwin, role, actor, reason);
-                }
+                mucwin_role_change(mucwin, role, actor, reason);
 
             // affiliation changed
             } else if (g_strcmp0(affiliation, old_affiliation) != 0) {
-                ProfMucWin *mucwin = wins_get_muc(room);
-                if (mucwin) {
-                    mucwin_affiliation_change(mucwin, affiliation, actor, reason);
-                }
+                mucwin_affiliation_change(mucwin, affiliation, actor, reason);
             }
         }
     }