Code: Select all
static int got474(char *from, char *msg)
{
char *chname;
struct chanset_t *chan;
newsplit(&msg);
chname = newsplit(&msg);
/* !channel short names (also referred to as 'description names'
* can be received by skipping over the unique ID.
*/
if ((chname[0] == '!') && (strlen(chname) > CHANNEL_ID_LEN)) {
chname += CHANNEL_ID_LEN;
chname[0] = '!';
}
/* We use dname because name is first set on JOIN and we might not
* have joined the channel yet.
*/
chan = findchan_by_dname(chname);
if (chan) {
putlog(LOG_JOIN, chan->dname, IRC_BANNEDFROMCHAN, chan->dname);
check_tcl_need(chan->dname, "unban");
chan = findchan_by_dname(chname);
if (!chan)
return 0;
dprintf(DP_MODE, "JOIN %s\n", chan->name); /* this one will let bot to try joining once again till if succeed */
if (chan->need_unban[0])
do_tcl("need-unban", chan->need_unban);
} else
putlog(LOG_JOIN, chname, IRC_BANNEDFROMCHAN, chname);
return 0;
}