about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/mucwin.c122
-rw-r--r--src/ui/ui.h2
2 files changed, 62 insertions, 62 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index 396f6331..e1c5bac3 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -561,7 +561,7 @@ mucwin_affiliation_list_error(const char *const roomjid, const char *const affil
 }
 
 void
-ui_handle_room_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids)
+mucwin_handle_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids)
 {
     ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
     if (window) {
@@ -582,6 +582,66 @@ ui_handle_room_affiliation_list(const char *const roomjid, const char *const aff
 }
 
 void
+ui_show_room_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
+{
+    ProfWin *window = (ProfWin*) mucwin;
+    GSList *occupants = muc_occupants_by_affiliation(mucwin->roomjid, affiliation);
+
+    if (!occupants) {
+        switch (affiliation) {
+            case MUC_AFFILIATION_OWNER:
+                win_print(window, '!', 0, NULL, 0, 0, "", "No owners found.");
+                break;
+            case MUC_AFFILIATION_ADMIN:
+                win_print(window, '!', 0, NULL, 0, 0, "", "No admins found.");
+                break;
+            case MUC_AFFILIATION_MEMBER:
+                win_print(window, '!', 0, NULL, 0, 0, "", "No members found.");
+                break;
+            case MUC_AFFILIATION_OUTCAST:
+                win_print(window, '!', 0, NULL, 0, 0, "", "No outcasts found.");
+                break;
+            default:
+                break;
+        }
+        win_print(window, '-', 0, NULL, 0, 0, "", "");
+    } else {
+        switch (affiliation) {
+            case MUC_AFFILIATION_OWNER:
+                win_print(window, '!', 0, NULL, 0, 0, "", "Owners:");
+                break;
+            case MUC_AFFILIATION_ADMIN:
+                win_print(window, '!', 0, NULL, 0, 0, "", "Admins:");
+                break;
+            case MUC_AFFILIATION_MEMBER:
+                win_print(window, '!', 0, NULL, 0, 0, "", "Members:");
+                break;
+            case MUC_AFFILIATION_OUTCAST:
+                win_print(window, '!', 0, NULL, 0, 0, "", "Outcasts:");
+                break;
+            default:
+                break;
+        }
+
+        GSList *curr_occupant = occupants;
+        while(curr_occupant) {
+            Occupant *occupant = curr_occupant->data;
+            if (occupant->affiliation == affiliation) {
+                if (occupant->jid) {
+                    win_vprint(window, '!', 0, NULL, 0, 0, "", "  %s (%s)", occupant->nick, occupant->jid);
+                } else {
+                    win_vprint(window, '!', 0, NULL, 0, 0, "", "  %s", occupant->nick);
+                }
+            }
+
+            curr_occupant = g_slist_next(curr_occupant);
+        }
+
+        win_print(window, '-', 0, NULL, 0, 0, "", "");
+    }
+}
+
+void
 ui_handle_room_role_list_error(const char *const roomjid, const char *const role, const char *const error)
 {
     ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
@@ -708,66 +768,6 @@ ui_show_room_role_list(ProfMucWin *mucwin, muc_role_t role)
 }
 
 void
-ui_show_room_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
-{
-    ProfWin *window = (ProfWin*) mucwin;
-    GSList *occupants = muc_occupants_by_affiliation(mucwin->roomjid, affiliation);
-
-    if (!occupants) {
-        switch (affiliation) {
-            case MUC_AFFILIATION_OWNER:
-                win_print(window, '!', 0, NULL, 0, 0, "", "No owners found.");
-                break;
-            case MUC_AFFILIATION_ADMIN:
-                win_print(window, '!', 0, NULL, 0, 0, "", "No admins found.");
-                break;
-            case MUC_AFFILIATION_MEMBER:
-                win_print(window, '!', 0, NULL, 0, 0, "", "No members found.");
-                break;
-            case MUC_AFFILIATION_OUTCAST:
-                win_print(window, '!', 0, NULL, 0, 0, "", "No outcasts found.");
-                break;
-            default:
-                break;
-        }
-        win_print(window, '-', 0, NULL, 0, 0, "", "");
-    } else {
-        switch (affiliation) {
-            case MUC_AFFILIATION_OWNER:
-                win_print(window, '!', 0, NULL, 0, 0, "", "Owners:");
-                break;
-            case MUC_AFFILIATION_ADMIN:
-                win_print(window, '!', 0, NULL, 0, 0, "", "Admins:");
-                break;
-            case MUC_AFFILIATION_MEMBER:
-                win_print(window, '!', 0, NULL, 0, 0, "", "Members:");
-                break;
-            case MUC_AFFILIATION_OUTCAST:
-                win_print(window, '!', 0, NULL, 0, 0, "", "Outcasts:");
-                break;
-            default:
-                break;
-        }
-
-        GSList *curr_occupant = occupants;
-        while(curr_occupant) {
-            Occupant *occupant = curr_occupant->data;
-            if (occupant->affiliation == affiliation) {
-                if (occupant->jid) {
-                    win_vprint(window, '!', 0, NULL, 0, 0, "", "  %s (%s)", occupant->nick, occupant->jid);
-                } else {
-                    win_vprint(window, '!', 0, NULL, 0, 0, "", "  %s", occupant->nick);
-                }
-            }
-
-            curr_occupant = g_slist_next(curr_occupant);
-        }
-
-        win_print(window, '-', 0, NULL, 0, 0, "", "");
-    }
-}
-
-void
 ui_room_update_occupants(const char *const roomjid)
 {
     ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
diff --git a/src/ui/ui.h b/src/ui/ui.h
index b0fa4867..b138386d 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -157,7 +157,7 @@ void ui_handle_room_config_submit_result(const char *const roomjid);
 void ui_handle_room_config_submit_result_error(const char *const roomjid, const char *const message);
 void mucwin_affiliation_list_error(const char *const roomjid, const char *const affiliation,
     const char *const error);
-void ui_handle_room_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids);
+void mucwin_handle_affiliation_list(const char *const roomjid, const char *const affiliation, GSList *jids);
 void ui_handle_room_affiliation_set_error(const char *const roomjid, const char *const jid,
     const char *const affiliation, const char *const error);
 void ui_handle_room_role_set_error(const char *const roomjid, const char *const nick, const char *const role,