From 9a5fe29caa230a5229c26470ef693d2fc102add6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 8 Jul 2015 20:51:39 +0100 Subject: Changed /roster empty -> /roster remove_all contacts Make it difficult to accidentally use this command. --- src/command/command.c | 51 ++++++++++++++++++++++++++++++-------------------- src/command/commands.c | 6 +++++- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/command/command.c b/src/command/command.c index 8ed3a3b6..bfd16b9f 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -190,26 +190,26 @@ static struct cmd_t command_defs[] = "--------------------------", "Manage your roster, and roster display settings.", "", - "command - online|show|hide|by|size|add|remove|nick|clearnick", - "", - "online : Show all online contacts in your roster.", - "show : Show the roster panel.", - "show offline : Show offline contacts in the roster panel.", - "show resource : Show contact's connected resources in the roster panel.", - "show empty : When grouping by presence, show empty presence groups", - "hide : Hide the roster panel.", - "hide offline : Hide offline contacts in the roster panel.", - "hide resource : Hide contact's connected resources in the roster panel.", - "hide empty : When grouping by presence, hide empty presence groups", - "by group : Group contacts in the roster panel by roster group.", - "by presence : Group contacts in the roster panel by presence.", - "by none : No grouping in the roster panel.", - "size : Percentage of the screen taken up by the roster (1-99).", - "add jid [nick] : Add a new item to the roster.", - "remove jid : Removes an item from the roster.", - "empty : Remove all items from roster." - "nick jid nick : Change a contacts nickname.", - "clearnick jid : Removes the current nickname.", + "command - online|show|hide|by|size|add|remove|remove_all|nick|clearnick", + "", + "online : Show all online contacts in your roster.", + "show : Show the roster panel.", + "show offline : Show offline contacts in the roster panel.", + "show resource : Show contact's connected resources in the roster panel.", + "show empty : When grouping by presence, show empty presence groups", + "hide : Hide the roster panel.", + "hide offline : Hide offline contacts in the roster panel.", + "hide resource : Hide contact's connected resources in the roster panel.", + "hide empty : When grouping by presence, hide empty presence groups", + "by group : Group contacts in the roster panel by roster group.", + "by presence : Group contacts in the roster panel by presence.", + "by none : No grouping in the roster panel.", + "size : Percentage of the screen taken up by the roster (1-99).", + "add jid [nick] : Add a new item to the roster.", + "remove jid : Removes an item from the roster.", + "remove_all contacts : Remove all items from roster.", + "nick jid nick : Change a contacts nickname.", + "clearnick jid : Removes the current nickname.", "", "Passing no arguments lists all contacts in your roster.", "", @@ -1217,6 +1217,7 @@ static Autocomplete wins_ac; static Autocomplete roster_ac; static Autocomplete roster_option_ac; static Autocomplete roster_by_ac; +static Autocomplete roster_remove_all_ac; static Autocomplete group_ac; static Autocomplete bookmark_ac; static Autocomplete bookmark_property_ac; @@ -1432,6 +1433,7 @@ cmd_init(void) autocomplete_add(roster_ac, "nick"); autocomplete_add(roster_ac, "clearnick"); autocomplete_add(roster_ac, "remove"); + autocomplete_add(roster_ac, "remove_all"); autocomplete_add(roster_ac, "empty"); autocomplete_add(roster_ac, "show"); autocomplete_add(roster_ac, "hide"); @@ -1448,6 +1450,9 @@ cmd_init(void) autocomplete_add(roster_by_ac, "presence"); autocomplete_add(roster_by_ac, "none"); + roster_remove_all_ac = autocomplete_new(); + autocomplete_add(roster_remove_all_ac, "contacts"); + group_ac = autocomplete_new(); autocomplete_add(group_ac, "show"); autocomplete_add(group_ac, "add"); @@ -1657,6 +1662,7 @@ cmd_uninit(void) autocomplete_free(roster_ac); autocomplete_free(roster_option_ac); autocomplete_free(roster_by_ac); + autocomplete_free(roster_remove_all_ac); autocomplete_free(group_ac); autocomplete_free(bookmark_ac); autocomplete_free(bookmark_property_ac); @@ -1830,6 +1836,7 @@ cmd_reset_autocomplete(ProfWin *window) autocomplete_reset(roster_ac); autocomplete_reset(roster_option_ac); autocomplete_reset(roster_by_ac); + autocomplete_reset(roster_remove_all_ac); autocomplete_reset(group_ac); autocomplete_reset(titlebar_ac); autocomplete_reset(bookmark_ac); @@ -2188,6 +2195,10 @@ _roster_autocomplete(ProfWin *window, const char * const input) if (result) { return result; } + result = autocomplete_param_with_ac(input, "/roster remove_all", roster_remove_all_ac, TRUE); + if (result) { + return result; + } result = autocomplete_param_with_ac(input, "/roster show", roster_option_ac, TRUE); if (result) { return result; diff --git a/src/command/commands.c b/src/command/commands.c index 8c071048..757b8115 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1678,7 +1678,11 @@ cmd_roster(ProfWin *window, gchar **args, struct cmd_help_t help) } return TRUE; - } else if (strcmp(args[0], "empty") == 0) { + } else if (strcmp(args[0], "remove_all") == 0) { + if (g_strcmp0(args[1], "contacts") != 0) { + cons_show("Usage: %s", help.usage); + return TRUE; + } if (conn_status != JABBER_CONNECTED) { cons_show("You are not currently connected."); return TRUE; -- cgit 1.4.1-2-gfad0 -11 20:13:18 +0200 committer Dominik Heidler <dominik@heidler.eu> 2016-04-26 23:50:55 +0200 Implement XEP-0363: HTTP File Upload' href='/danisanti/profani-tty/commit/src/tools/http_upload.c?id=1b0ce852bba81c3bbed1f7cbf04d0b60f1f0961b'>1b0ce852 ^
772a72b6 ^

9b55f2de ^
a4cadf78 ^
1b0ce852 ^


a4cadf78 ^



1b0ce852 ^
9b55f2de ^
a4cadf78 ^
0a57c4de ^
a4cadf78 ^
0a57c4de ^

a4cadf78 ^
1b0ce852 ^
a2726b6a ^
043a673f ^
a2726b6a ^

1b0ce852 ^
a2726b6a ^


1b0ce852 ^


a2726b6a ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^
a2726b6a ^
1b0ce852 ^



















1ec60654 ^


1b0ce852 ^

1ec60654 ^
1b0ce852 ^







a2726b6a ^
1b0ce852 ^





a2726b6a ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^

a2726b6a ^

1b0ce852 ^
a2726b6a ^
1b0ce852 ^




4711fc62 ^


e9d58757 ^
4711fc62 ^
e9d58757 ^























4711fc62 ^

1b0ce852 ^
a2726b6a ^
1b0ce852 ^
4711fc62 ^
1b0ce852 ^
a2726b6a ^
1ec60654 ^
e217ed0b ^
1ec60654 ^


1b0ce852 ^
a2726b6a ^
1b0ce852 ^





1ec60654 ^


1b0ce852 ^
9499df65 ^
1ec60654 ^
1b0ce852 ^
a2726b6a ^
1b0ce852 ^







a2726b6a ^
1ec60654 ^
e9ef3cf1 ^
1ec60654 ^
1b0ce852 ^


e217ed0b ^


1ec60654 ^


c29343b8 ^
e217ed0b ^


1ec60654 ^


c29343b8 ^
e217ed0b ^


1ec60654 ^


c29343b8 ^
e217ed0b ^


1b0ce852 ^

a2726b6a ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^





a2726b6a ^
1b0ce852 ^


39c32906 ^
1b0ce852 ^




39c32906 ^
1b0ce852 ^














1ec60654 ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^


a2726b6a ^
1b0ce852 ^

1b0ce852 ^


e217ed0b ^
39c32906 ^

1b0ce852 ^
1b0ce852 ^
1ec60654 ^



1b0ce852 ^

e5ac12af ^
1b0ce852 ^

1ec60654 ^
1b0ce852 ^
1ec60654 ^


1b0ce852 ^

1ec60654 ^


1b0ce852 ^



1ec60654 ^
1b0ce852 ^


1ec60654 ^


1b0ce852 ^

1b0ce852 ^
1ec60654 ^
1b0ce852 ^
4711fc62 ^
e9d58757 ^
1ec60654 ^


e98644f6 ^
e9d58757 ^
1ec60654 ^
e9d58757 ^



4711fc62 ^
e9d58757 ^





4711fc62 ^
e9d58757 ^





4711fc62 ^
e9d58757 ^








1b0ce852 ^










d5b1dc0e ^

e217ed0b ^


1b0ce852 ^





39c32906 ^
1b0ce852 ^
a2726b6a ^
1b0ce852 ^
4711fc62 ^
39c32906 ^
1b0ce852 ^

39c32906 ^

1b0ce852 ^
4711fc62 ^
1b0ce852 ^
a2726b6a ^
1b0ce852 ^

a2726b6a ^
1b0ce852 ^





4711fc62 ^

1b0ce852 ^

39c32906 ^
1b0ce852 ^

9be7d29f ^

a2726b6a ^
9be7d29f ^
a2726b6a ^
9be7d29f ^
a2726b6a ^
9be7d29f ^








a2726b6a ^
9be7d29f ^


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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427