about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-11-03 21:27:41 +0000
committerJames Booth <boothj5@gmail.com>2014-11-03 21:27:41 +0000
commit74a2d4601f2f3cf47eda17647a39482ad3a3b667 (patch)
tree1bfedd8a8041cf4adf63ce78c0e61d93bae46673 /src/ui
parent7a03dd7641d97a4f44bd78e82e7132213c88bd54 (diff)
downloadprofani-tty-74a2d4601f2f3cf47eda17647a39482ad3a3b667.tar.gz
Removed hash_table_iter usage for room roster
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/core.c14
-rw-r--r--src/ui/ui.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 08a1afb8..85605cad 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -2816,15 +2816,15 @@ _ui_muc_roster(const char * const room)
 {
     ProfWin *window = wins_get_by_recipient(room);
     if (window) {
-        GList *roster = muc_roster(room);
-        if (roster) {
+        GList *occupants = muc_roster(room);
+        if (occupants) {
             werase(window->subwin);
 
             if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
                 wattron(window->subwin, COLOUR_ROOMINFO);
                 wprintw(window->subwin, " -Moderators\n");
                 wattroff(window->subwin, COLOUR_ROOMINFO);
-                GList *roster_curr = roster;
+                GList *roster_curr = occupants;
                 while (roster_curr) {
                     Occupant *occupant = roster_curr->data;
                     if (occupant->role == MUC_ROLE_MODERATOR) {
@@ -2842,7 +2842,7 @@ _ui_muc_roster(const char * const room)
                 wattron(window->subwin, COLOUR_ROOMINFO);
                 wprintw(window->subwin, " -Participants\n");
                 wattroff(window->subwin, COLOUR_ROOMINFO);
-                roster_curr = roster;
+                roster_curr = occupants;
                 while (roster_curr) {
                     Occupant *occupant = roster_curr->data;
                     if (occupant->role == MUC_ROLE_PARTICIPANT) {
@@ -2860,7 +2860,7 @@ _ui_muc_roster(const char * const room)
                 wattron(window->subwin, COLOUR_ROOMINFO);
                 wprintw(window->subwin, " -Visitors\n");
                 wattroff(window->subwin, COLOUR_ROOMINFO);
-                roster_curr = roster;
+                roster_curr = occupants;
                 while (roster_curr) {
                     Occupant *occupant = roster_curr->data;
                     if (occupant->role == MUC_ROLE_VISITOR) {
@@ -2878,7 +2878,7 @@ _ui_muc_roster(const char * const room)
                 wattron(window->subwin, COLOUR_ROOMINFO);
                 wprintw(window->subwin, " -Occupants\n");
                 wattroff(window->subwin, COLOUR_ROOMINFO);
-                GList *roster_curr = roster;
+                GList *roster_curr = occupants;
                 while (roster_curr) {
                     Occupant *occupant = roster_curr->data;
                     wprintw(window->subwin, "   ");
@@ -2892,6 +2892,8 @@ _ui_muc_roster(const char * const room)
                 }
             }
         }
+
+        g_list_free(occupants);
     }
 }
 
diff --git a/src/ui/ui.h b/src/ui/ui.h
index eb610801..b3c5be1f 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -143,7 +143,7 @@ void (*ui_room_occupant_affiliation_change)(const char * const room, const char
     const char * const actor, const char * const reason);
 void (*ui_room_occupant_role_and_affiliation_change)(const char * const room, const char * const nick, const char * const role,
     const char * const affiliation, const char * const actor, const char * const reason);
-void (*ui_room_roster)(const char * const room, GList *roster, const char * const presence);
+void (*ui_room_roster)(const char * const room, GList *occupants, const char * const presence);
 void (*ui_room_history)(const char * const room_jid, const char * const nick,
     GTimeVal tv_stamp, const char * const message);
 void (*ui_room_message)(const char * const room_jid, const char * const nick,