void hchannels_dnmo(struct huser_struct *husr)
{
    hchannel *hchan = hchannels;
    for (;hchan;hchan = hchan->next)
    {
        huser_channel *huserchan = huser_on_channel(husr, hchan);
        /*if (on_queue(husr, huserchan) || on_desk(husr, huserchan))*/
        if (huserchan != NULL)
        {
            hchannel_user *tmp = NULL, **hchanuser = &hchan->channel_users;
            for (;*hchanuser;hchanuser = &(*hchanuser)->next)
                if ((*hchanuser)->husr == husr)
                {
                    tmp = *hchanuser;
                    *hchanuser = (*hchanuser)->next;
                    if (!*hchanuser)
                        break;
                }
            *hchanuser = tmp;
            assert(*hchanuser != NULL);
            (*hchanuser)->next = NULL;
            if (on_desk(husr, huserchan))
            {
                helpmod_channick_modes(husr, hchan, MC_DEVOICE, HLAZY);
                huserchan->flags &= ~HQUEUE_DONE;
            }
        }
    }
}
int hchannels_on_desk(struct huser_struct* husr)
{
    huser_channel *huserchan = husr->hchannels;
    for (;huserchan;huserchan = huserchan->next)
        if (on_desk(husr, huserchan))
            return 1;
    return 0;
}
Beispiel #3
0
static int hqueue_count_off_queue(hchannel *hchan)
{
    int count;
    hqueue_entry *tmp = hqueue_get_next(hchan);

    for (count = 0;tmp;tmp = hqueue_get_next(NULL))
        if (on_desk(tmp->hchanuser->husr, tmp->huserchan))
        count++;

    return count;
}