Kod: Kodu kopyalamak için üzerine çift tıklayın!
static void do_drop(User *u)
{
char *chan = strtok(NULL, " ");
ChannelInfo *ci;
int is_servadmin = is_services_admin(u);
Channel *c;
if (readonly && !is_servadmin) {
notice_lang(s_ChanServ, u, CHAN_DROP_DISABLED);
return;
}
if (!chan) {
syntax_error(s_ChanServ, u, "DROP", CHAN_DROP_SYNTAX);
} else if (!(ci = get_channelinfo(chan))) {
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
} else if (!is_servadmin && (ci->flags & CI_VERBOTEN)) {
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
} else if (!is_servadmin && ci->suspendinfo) {
notice_lang(s_ChanServ, u, CHAN_X_SUSPENDED, chan);
} else if (!is_servadmin && !is_identified(u, ci)) {
notice_lang(s_ChanServ, u, CHAN_IDENTIFY_REQUIRED, s_ChanServ, chan);
} else {
const char *founder;
char tmpbuf[64];
if (readonly) /* in this case we know they're a Services admin */
notice_lang(s_ChanServ, u, READ_ONLY_MODE);
if (ci->founder) {
NickGroupInfo *ngi = get_ngi_id(ci->founder);
if (ngi) {
founder = ngi_mainnick(ngi);
} else {
snprintf(tmpbuf, sizeof(tmpbuf), "<unknown: ID %u>",
ci->founder);
founder = tmpbuf;
}
} else {
founder = "<none>";
}
module_log("Channel %s (founder %s) dropped by %s!%s@%s",
ci->name, founder, u->nick, u->username, u->host);
delchan(ci);
if (chanmode_reg && (c = get_channel(chan))) {
c->mode &= ~chanmode_reg;
send_cmode_cmd(s_ChanServ, chan, "-%s",
mode_flags_to_string(chanmode_reg, MODE_CHANNEL));
}
notice_lang(s_ChanServ, u, CHAN_DROPPED, chan);
}
}
Droplamak icinse, services admin olmali ve admin list'te yer almalisiniz.