Changeset 7eb46d4 in code for cmd.c


Ignore:
Timestamp:
Dec 24, 2013, 3:29:41 PM (11 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
8886035
Parents:
1fb1bbe
git-author:
Stuart Henderson <stu@…> (03/18/13 00:44:42)
git-committer:
Mike Belopuhov <mike@…> (12/24/13 15:29:41)
Message:

fix moderator handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r1fb1bbe r7eb46d4  
    202202
    203203void
    204 icb_cmd_pass(struct icb_session *is, char *arg __attribute__((unused)))
    205 {
    206         if (!icb_ismoder(is->group, is))
    207                 (void)icb_pass(is->group, is->group->moder, is);
     204icb_cmd_pass(struct icb_session *is, char *arg)
     205{
     206        struct icb_group *ig = is->group;
     207        struct icb_session *s;
     208
     209        if (!ig->moder)         /* if there is no mod, let anyone grab it */
     210                (void)icb_pass(ig, ig->moder, is);
     211        else if (icb_ismoder(ig, is)) {
     212                LIST_FOREACH(s, &ig->sess, entry) {
     213                        if (strcmp(s->nick, arg) == 0)
     214                                break;
     215                }
     216                if (s == NULL) {
     217                        icb_status(is, STATUS_NOTIFY, "No such user");
     218                        return;
     219                }
     220                (void)icb_pass(ig, ig->moder, s);
     221        }
    208222}
    209223
Note: See TracChangeset for help on using the changeset viewer.