about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-09 13:16:36 +0100
committerJames Booth <boothj5@gmail.com>2014-10-09 13:16:36 +0100
commit778a495fbd708fbb1ac9c6f9eb3c4890a4a51bc3 (patch)
treeaf21682295ed35d7659bb90d5e21e6eea00a4660 /src/ui
parentf6e0a219ffb49b77a1d022ba5b33ca5c3a763c0b (diff)
downloadprofani-tty-778a495fbd708fbb1ac9c6f9eb3c4890a4a51bc3.tar.gz
Added /occupants commands, unfinished
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/core.c22
-rw-r--r--src/ui/ui.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index a96d152d..6ed88e11 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -2721,7 +2721,7 @@ static void
 _ui_muc_roster(const char * const room)
 {
     ProfWin *window = wins_get_by_recipient(room);
-    if (room) {
+    if (window) {
         GList *roster = muc_roster(room);
         if (roster) {
             werase(window->subwin);
@@ -2784,6 +2784,24 @@ _ui_muc_roster(const char * const room)
 }
 
 static void
+_ui_room_show_occupants(const char * const room)
+{
+    ProfWin *window = wins_get_by_recipient(room);
+    if (window && !window->subwin) {
+        cons_debug("Showing occupants");
+    }
+}
+
+static void
+_ui_room_hide_occupants(const char * const room)
+{
+    ProfWin *window = wins_get_by_recipient(room);
+    if (window && window->subwin) {
+        cons_debug("Hiding occupants");
+    }
+}
+
+static void
 _win_handle_switch(const wint_t * const ch)
 {
     if (*ch == KEY_F(1)) {
@@ -3079,5 +3097,7 @@ ui_init_module(void)
     ui_handle_room_role_list_error = _ui_handle_room_role_list_error;
     ui_handle_room_role_list = _ui_handle_room_role_list;
     ui_muc_roster = _ui_muc_roster;
+    ui_room_show_occupants = _ui_room_show_occupants; 
+    ui_room_hide_occupants = _ui_room_hide_occupants;
 }
 
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 0c61c296..12969291 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -162,6 +162,8 @@ void (*ui_room_member_nick_change)(const char * const room,
 void (*ui_room_nick_change)(const char * const room, const char * const nick);
 void (*ui_room_member_presence)(const char * const room,
     const char * const nick, const char * const show, const char * const status);
+void (*ui_room_show_occupants)(const char * const room);
+void (*ui_room_hide_occupants)(const char * const room);
 void (*ui_roster_add)(const char * const barejid, const char * const name);
 void (*ui_roster_remove)(const char * const barejid);
 void (*ui_contact_already_in_group)(const char * const contact, const char * const group);