about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-04-23 14:10:18 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-04-23 14:13:08 +0200
commit028839e35a0e63932e3fb4d8495451eb9a0337c1 (patch)
tree375da8cee703c200cbb087eb3398dfc2e71422a6 /src/command/cmd_funcs.c
parent566022786d458802223340dffc450529637775ca (diff)
downloadprofani-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.c37
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);
9-05-13 01:18:43 -0400 more stubbed tests' href='/gbmor/getwtxt/commit/handlers_test.go?h=v0.4.7&id=126c00e4329f3e1f0efa210318f022f4248c53e2'>126c00e ^
45a6722 ^

126c00e ^
45a6722 ^






d6fbc25 ^























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126