Mercurial > hg
comparison mcabber/src/commands.c @ 130:60694c9ddde3
[/trunk] Changeset 143 by mikael
* Add "/group toggle".
* Commands parameters are case-insensitive.
author | mikael |
---|---|
date | Thu, 28 Apr 2005 14:10:46 +0000 |
parents | 03be1cc94560 |
children | 6531bcf030ae |
comparison
equal
deleted
inserted
replaced
129:03be1cc94560 | 130:60694c9ddde3 |
---|---|
96 compl_add_category_word(COMPL_ROSTER, "top"); | 96 compl_add_category_word(COMPL_ROSTER, "top"); |
97 | 97 |
98 // Group category | 98 // Group category |
99 compl_add_category_word(COMPL_GROUP, "expand"); | 99 compl_add_category_word(COMPL_GROUP, "expand"); |
100 compl_add_category_word(COMPL_GROUP, "shrink"); | 100 compl_add_category_word(COMPL_GROUP, "shrink"); |
101 compl_add_category_word(COMPL_GROUP, "toggle"); | |
101 } | 102 } |
102 | 103 |
103 // cmd_get | 104 // cmd_get |
104 // Finds command in the command list structure. | 105 // Finds command in the command list structure. |
105 // Returns a pointer to the cmd entry, or NULL if command not found. | 106 // Returns a pointer to the cmd entry, or NULL if command not found. |
248 if (!arg || (*arg == 0)) { | 249 if (!arg || (*arg == 0)) { |
249 scr_LogPrint("Your status is: %c", imstatus2char[jb_getstatus()]); | 250 scr_LogPrint("Your status is: %c", imstatus2char[jb_getstatus()]); |
250 return; | 251 return; |
251 } | 252 } |
252 | 253 |
253 if (!strcmp(arg, "offline")) st = offline; | 254 if (!strcasecmp(arg, "offline")) st = offline; |
254 else if (!strcmp(arg, "online")) st = available; | 255 else if (!strcasecmp(arg, "online")) st = available; |
255 else if (!strcmp(arg, "avail")) st = available; | 256 else if (!strcasecmp(arg, "avail")) st = available; |
256 else if (!strcmp(arg, "away")) st = away; | 257 else if (!strcasecmp(arg, "away")) st = away; |
257 else if (!strcmp(arg, "invisible")) st = invisible; | 258 else if (!strcasecmp(arg, "invisible")) st = invisible; |
258 else if (!strcmp(arg, "dnd")) st = dontdisturb; | 259 else if (!strcasecmp(arg, "dnd")) st = dontdisturb; |
259 else if (!strcmp(arg, "busy")) st = occupied; | 260 else if (!strcasecmp(arg, "busy")) st = occupied; |
260 else if (!strcmp(arg, "notavail")) st = notavail; | 261 else if (!strcasecmp(arg, "notavail")) st = notavail; |
261 else if (!strcmp(arg, "free")) st = freeforchat; | 262 else if (!strcasecmp(arg, "free")) st = freeforchat; |
262 else { | 263 else { |
263 scr_LogPrint("Unrecognized parameter!"); | 264 scr_LogPrint("Unrecognized parameter!"); |
264 return; | 265 return; |
265 } | 266 } |
266 | 267 |
296 if (!(buddy_gettype(group) & ROSTER_TYPE_GROUP)) { | 297 if (!(buddy_gettype(group) & ROSTER_TYPE_GROUP)) { |
297 scr_LogPrint("For now you need to select a group " | 298 scr_LogPrint("For now you need to select a group " |
298 "before using /group"); | 299 "before using /group"); |
299 return; | 300 return; |
300 } | 301 } |
301 if (!strcmp(arg, "expand")) { | 302 if (!strcasecmp(arg, "expand")) { |
302 buddy_setflags(group, ROSTER_FLAG_HIDE, FALSE); | 303 buddy_setflags(group, ROSTER_FLAG_HIDE, FALSE); |
303 } else if (!strcmp(arg, "shrink")) { | 304 } else if (!strcasecmp(arg, "shrink")) { |
304 buddy_setflags(group, ROSTER_FLAG_HIDE, TRUE); | 305 buddy_setflags(group, ROSTER_FLAG_HIDE, TRUE); |
306 } else if (!strcasecmp(arg, "toggle")) { | |
307 buddy_setflags(group, ROSTER_FLAG_HIDE, | |
308 !(buddy_getflags(group) & ROSTER_FLAG_HIDE)); | |
305 } else { | 309 } else { |
306 scr_LogPrint("Unrecognized parameter!"); | 310 scr_LogPrint("Unrecognized parameter!"); |
307 return; | 311 return; |
308 } | 312 } |
309 | 313 |