sendbuf_visible_caps(client, 0, 0);
}
const char *format_umodes(struct client_data *cl) {
- static char umodes[6] = "";
+ static char umodes[8] = "";
char *p = umodes;
*p++ = '+';
if (cl->umode & UMODE_INVISIBLE) *p++ = 'i';
if (cl->umode & UMODE_REGISTERED) *p++ = 'r';
if (cl->umode & UMODE_WALLOPS) *p++ = 'w';
if (cl->umode & UMODE_SECURE) *p++ = 'Z';
+ if (cl->umode & UMODE_BOT) *p++ = 'B';
*p++ = '\0';
return umodes;
}
sendbuf(client);
}
break;
+ case 'B':
+ SETBIT(cl->umode, UMODE_BOT, is_plus);
+ copy_strf(&databuf, ":%s MODE %s %sB\n", hostname, client->nick, is_plus?"+":"-");
+ sendbuf(client);
+ break;
default:
copy_strf(&databuf, ":%s 501 %s :Unknown MODE flag\n", hostname, client->nick);
sendbuf(client);
if (client == cl || client->umode & UMODE_OPER)
rpl_whoisactually(client, cl), sendbuf(client);
rpl_whoismodes(client, cl), sendbuf(client);
+ if (client->umode & UMODE_BOT)
+ rpl_whoisbot(client, cl), sendbuf(client);
rpl_endofwhois(client, cl), sendbuf(client);
} else {
err_nosuchnick(client, nick);
}
void rpl_isupport(struct client_data *client) // 005
{
- copy_strf(&databuf, ":%s 005 %s CASEMAPPING=ascii NICKLEN=%u EXCEPTS=e INVEX=I MAXTARGETS=1 CHANMODES=beIqw,k,l,Pimnst CHANTYPES=#& PREFIX=(ov)@+ STATUSMSG=@+ :are supported by this server\r\n", hostname, client->nick, MAX_NICKLEN-1);
+ copy_strf(&databuf, ":%s 005 %s CASEMAPPING=ascii NICKLEN=%u EXCEPTS=e INVEX=I MAXTARGETS=1 CHANMODES=beIqw,k,l,Pimnst CHANTYPES=#& PREFIX=(ov)@+ STATUSMSG=@+ BOT=B :are supported by this server\r\n", hostname, client->nick, MAX_NICKLEN-1);
}
#if 0
}
void rpl_whoreply(struct client_data *client, struct client_data *cl, struct channel *chan) // 352
{
- copy_strf(&databuf, ":%s 352 %s %s %s %s %s %s %s%s%s :1 %s\r\n",
+ copy_strf(&databuf, ":%s 352 %s %s %s %s %s %s %s%s%s%s :1 %s\r\n",
hostname, client->nick, chan ? chan->name : "*", cl->username, cl->hostname, hostname, cl->nick,
- cl->away ? "G" : "H", cl->umode&UMODE_OPER ? "*" : "", format_prefixes(client, cl, chan), cl->realname);
+ cl->away ? "G" : "H", cl->umode&UMODE_BOT ? "B" : "",
+ cl->umode&UMODE_OPER ? "*" : "", format_prefixes(client, cl, chan), cl->realname);
}
void rpl_endofwho(struct client_data *client, const char *query) // 315
{
copy_strf(&databuf, ":%s 333 %s %s %s %u\r\n", hostname, client->nick,
chan->name, chan->topic_who, (unsigned)chan->topic_when);
}
+void rpl_whoisbot(struct client_data *client, struct client_data *cl) // 335
+{
+ copy_strf(&databuf, ":%s 335 %s %s :is a bot\r\n", hostname, client->nick, cl->nick);
+}
void rpl_invitelist(struct client_data *client, struct channel *chan) // 336
{
copy_strf(&databuf, ":%s 336 %s %s\r\n", hostname, client->nick, chan->name);
void rpl_notopic(struct client_data *client, struct channel *chan); // 331
void rpl_topic(struct client_data *client, struct channel *chan); // 332
void rpl_topicwhotime(struct client_data *client, struct channel *chan); // 333
+void rpl_whoisbot(struct client_data *client, struct client_data *cl); // 335
void rpl_invitelist(struct client_data *client, struct channel *chan); // 336
void rpl_endofinvitelist(struct client_data *client); // 337
void rpl_whoisactually(struct client_data *client, struct client_data *cl); // 338