about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c7
-rw-r--r--src/ui/core.c14
-rw-r--r--src/ui/ui.h1
3 files changed, 16 insertions, 6 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 65759c0a..4a3cdd43 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2078,12 +2078,7 @@ cmd_room(gchar **args, struct cmd_help_t help)
     }
 
     if (g_strcmp0(args[0], "info") == 0) {
-        char *role = muc_role_str(room);
-        char *affiliation = muc_affiliation_str(room);
-        win_save_print(window, '-', NULL, 0, 0, "", "");
-        win_save_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation);
-        win_save_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role);
-        win_save_print(window, '-', NULL, 0, 0, "", "");
+        ui_show_room_info(window, room);
         return TRUE;
     }
 
diff --git a/src/ui/core.c b/src/ui/core.c
index 500e435b..7c6d24cb 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1887,6 +1887,19 @@ _ui_draw_term_title(void)
 }
 
 static void
+_ui_show_room_info(ProfWin *window, const char * const room)
+{
+    char *role = muc_role_str(room);
+    char *affiliation = muc_affiliation_str(room);
+
+    win_save_print(window, '-', NULL, 0, 0, "", "");
+    win_save_vprint(window, '!', NULL, 0, 0, "", "Room: %s", room);
+    win_save_vprint(window, '!', NULL, 0, 0, "", "  Affiliation: %s", affiliation);
+    win_save_vprint(window, '!', NULL, 0, 0, "", "  Role: %s", role);
+    win_save_print(window, '-', NULL, 0, 0, "", "");
+}
+
+static void
 _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
 {
     win_save_vprint(window, '-', NULL, NO_EOL, COLOUR_AWAY, "", "[%s] ", tag);
@@ -2513,4 +2526,5 @@ ui_init_module(void)
     ui_show_form_field_help = _ui_show_form_field_help;
     ui_show_lines = _ui_show_lines;
     ui_handle_room_configuration_form_error = _ui_handle_room_configuration_form_error;
+    ui_show_room_info = _ui_show_room_info;
 }
diff --git a/src/ui/ui.h b/src/ui/ui.h
index d71a78c1..85649c0e 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -137,6 +137,7 @@ void (*ui_room_subject)(const char * const room_jid,
     const char * const subject);
 void (*ui_room_requires_config)(const char * const room_jid);
 void (*ui_room_destroyed)(const char * const room_jid);
+void (*ui_show_room_info)(ProfWin *window, const char * const room);
 void (*ui_room_broadcast)(const char * const room_jid,
     const char * const message);
 void (*ui_room_member_offline)(const char * const room, const char * const nick);