Changeset f3c60e6 in code for cmd.c


Ignore:
Timestamp:
Mar 6, 2014, 3:30:44 PM (11 years ago)
Author:
Mike Belopuhov <mike@…>
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)
Message:

After some deliberation we have decided that if modtab is enabled
then it should be possible to steal the moderation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r3fdebb8 rf3c60e6  
    303303        char whom[ICB_MAXNICKLEN];
    304304
    305         if (!ig->mod) {         /* if there is no mod, let anyone grab it */
    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)
    307307                        icb_error(is, "Acquiring group moderation failed.");
    308308        } else if (icb_ismod(ig, is)) {
     
    321321                        return;
    322322                }
    323                 if (icb_pass(ig, ig->mod, s) < 0)
     323                if (icb_modpermit(s, 0) && icb_pass(ig, ig->mod, s) < 0)
    324324                        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.");
    325333        }
    326334}
Note: See TracChangeset for help on using the changeset viewer.