diff options
author | Michael Vetter <jubalh@iodoru.org> | 2019-04-23 14:10:18 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2019-04-23 14:13:08 +0200 |
commit | 028839e35a0e63932e3fb4d8495451eb9a0337c1 (patch) | |
tree | 375da8cee703c200cbb087eb3398dfc2e71422a6 /src/command/cmd_funcs.c | |
parent | 566022786d458802223340dffc450529637775ca (diff) | |
download | profani-tty-028839e35a0e63932e3fb4d8495451eb9a0337c1.tar.gz |
Put occupants update into own function
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 2118c44d..aa31c3af 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -4382,17 +4382,7 @@ cmd_occupants(ProfWin *window, const char *const command, gchar **args) prefs_set_occupants_indent(intval); cons_show("Occupants indent set to: %d", intval); - // get the list of joined rooms - GList *rooms = muc_rooms(); - GList *curr = rooms; - while (curr) { - char* roomjid = curr->data; - ProfMucWin *mw = wins_get_muc(roomjid); - if (mw != NULL) - mucwin_update_occupants(mw); - - curr = g_list_next(curr); - } + occupantswin_occupants_all(); } else { cons_show(err_msg); free(err_msg); @@ -4434,34 +4424,13 @@ cmd_occupants(ProfWin *window, const char *const command, gchar **args) } else if (g_strcmp0(args[2], "none") == 0) { prefs_clear_occupants_header_char(); cons_show("Occupants header char removed."); - // get the list of joined rooms - GList *rooms = muc_rooms(); - GList *curr = rooms; - while (curr) { - char* roomjid = curr->data; - ProfMucWin *mw = wins_get_muc(roomjid); - if (mw != NULL) - mucwin_update_occupants(mw); - - curr = g_list_next(curr); - } + occupantswin_occupants_all(); } else { prefs_set_occupants_header_char(args[2][0]); cons_show("Occupants header char set to %c.", args[2][0]); - //TODO:func like rosterwin_roster(); - // get the list of joined rooms - GList *rooms = muc_rooms(); - GList *curr = rooms; - while (curr) { - char* roomjid = curr->data; - ProfMucWin *mw = wins_get_muc(roomjid); - if (mw != NULL) - mucwin_update_occupants(mw); - - curr = g_list_next(curr); - } + occupantswin_occupants_all(); } } else { cons_bad_cmd_usage(command); |