- Timestamp:
- Mar 2, 2014, 1:50:39 AM (11 years ago)
- Branches:
- master
- Children:
- 2e37e9f
- Parents:
- 9195a6a
- git-author:
- Mike Belopuhov <mike@…> (03/02/14 01:45:33)
- git-committer:
- Mike Belopuhov <mike@…> (03/02/14 01:50:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
r9195a6a r4284008 1 1 /* 2 * Copyright (c) 2009, 2010 Mike Belopuhov2 * Copyright (c) 2009, 2010, 2013 Mike Belopuhov 3 3 * 4 4 * Permission to use, copy, modify, and distribute this software for any … … 113 113 /* to boot or not to boot, that is the question */ 114 114 ig = is->group; 115 if (!icb_ismod er(ig, is)) {115 if (!icb_ismod(ig, is)) { 116 116 icb_status(is, STATUS_NOTIFY, "Sorry, booting is a privilege " 117 117 "you don't possess"); … … 180 180 if (is->group) { 181 181 changing = 1; 182 if (icb_ismod er(is->group, is))182 if (icb_ismod(is->group, is)) 183 183 (void)icb_pass(is->group, is, NULL); 184 184 LIST_REMOVE(is, entry); … … 196 196 /* acknowledge successful join */ 197 197 icb_status(is, STATUS_STATUS, "You are now in group %s%s", ig->name, 198 icb_ismod er(ig, is) ? " as moderator" : "");198 icb_ismod(ig, is) ? " as moderator" : ""); 199 199 200 200 /* send user a topic name */ … … 285 285 struct icb_session *s; 286 286 287 if (!ig->mod er) /* if there is no mod, let anyone grab it */288 (void)icb_pass(ig, ig->mod er, is);289 else if (icb_ismod er(ig, is)) {287 if (!ig->mod) /* if there is no mod, let anyone grab it */ 288 (void)icb_pass(ig, ig->mod, is); 289 else if (icb_ismod(ig, is)) { 290 290 LIST_FOREACH(s, &ig->sess, entry) { 291 291 if (strcmp(s->nick, arg) == 0) … … 296 296 return; 297 297 } 298 (void)icb_pass(ig, ig->mod er, s);298 (void)icb_pass(ig, ig->mod, s); 299 299 } 300 300 } … … 312 312 icb_status(is, STATUS_TOPIC, "The topic is not set."); 313 313 } else { /* setting the topic */ 314 if (!icb_ismod er(ig, is)) {314 if (!icb_ismod(ig, is)) { 315 315 icb_status(is, STATUS_NOTIFY, "Setting the topic is " 316 316 "only for moderators."); … … 324 324 325 325 void 326 icb_cmd_who(struct icb_session *is, char *arg __attribute__((unused))) 327 { 328 icb_who(is, NULL); 329 } 326 icb_cmd_who(struct icb_session *is, char *arg) 327 { 328 struct icb_group *ig; 329 330 if (strlen(arg) == 0) 331 return icb_who(is, NULL); 332 333 LIST_FOREACH(ig, &groups, entry) { 334 if (strcmp(ig->name, arg) == 0) 335 break; 336 } 337 if (ig == NULL) { 338 icb_error(is, "The group %s doesn't exist.", arg); 339 return; 340 } 341 icb_who(is, ig); 342 }
Note:
See TracChangeset
for help on using the changeset viewer.