Changeset f3c60e6 in code
- Timestamp:
- Mar 6, 2014, 3:30:44 PM (11 years ago)
- Branches:
- master
- Children:
- 460786f
- Parents:
- 3fdebb8
- git-author:
- Mike Belopuhov <mike@…> (03/06/14 15:27:45)
- git-committer:
- Mike Belopuhov <mike@…> (03/06/14 15:30:44)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
r3fdebb8 rf3c60e6 303 303 char whom[ICB_MAXNICKLEN]; 304 304 305 if (!ig->mod) { /* if there is no mod, let anyone grabit */306 if (icb_ pass(ig, ig->mod, is) < 0)305 if (!ig->mod) { /* if there is no mod, try grabbing it */ 306 if (icb_modpermit(is, 0) && icb_pass(ig, ig->mod, is) < 0) 307 307 icb_error(is, "Acquiring group moderation failed."); 308 308 } else if (icb_ismod(ig, is)) { … … 321 321 return; 322 322 } 323 if (icb_ pass(ig, ig->mod, s) < 0)323 if (icb_modpermit(s, 0) && icb_pass(ig, ig->mod, s) < 0) 324 324 icb_error(s, "Acquiring group moderation failed."); 325 } else { 326 /* 327 * if group is moderated and we're not the moderator, 328 * but modtab is enabled, then check the permission 329 * and pass moderation if successful. 330 */ 331 if (icb_modpermit(is, 1) && icb_pass(ig, ig->mod, is) < 0) 332 icb_error(is, "Acquiring group moderation failed."); 325 333 } 326 334 } -
icb.c
r3fdebb8 rf3c60e6 37 37 void icb_login(struct icb_session *, char *, char *, char *); 38 38 int icb_dowho(struct icb_session *, struct icb_group *); 39 int icb_modpermit(struct icb_session *);40 39 char *icb_nextfield(char **); 41 40 … … 547 546 */ 548 547 int 549 icb_modpermit(struct icb_session *is )548 icb_modpermit(struct icb_session *is, int enforce) 550 549 { 551 550 extern char modtab[ICB_MTABLEN][ICB_MAXNICKLEN]; 552 551 extern int modtabcnt; 553 552 554 if ( modtabcnt == 0||553 if ((enforce ? 0 : modtabcnt == 0) || 555 554 bsearch(is->nick, modtab, modtabcnt, ICB_MAXNICKLEN, 556 555 (int (*)(const void *, const void *))strcmp)) … … 572 571 return (-1); 573 572 if (!from && !to) 574 return (-1);575 if (to && !icb_modpermit(to))576 573 return (-1); 577 574 ig->mod = to; -
icb.h
r3fdebb8 rf3c60e6 129 129 void icb_input(struct icb_session *); 130 130 inline int icb_ismod(struct icb_group *, struct icb_session *); 131 int icb_modpermit(struct icb_session * );131 int icb_modpermit(struct icb_session *, int); 132 132 int icb_pass(struct icb_group *, struct icb_session *, 133 133 struct icb_session *);
Note:
See TracChangeset
for help on using the changeset viewer.