if (trie_findfirst(&f, &channel_map) == 1)
do {
struct channel *chan = f->n->value;
- //copy_strf(&databuf, ":%s 322 %s %s %d :%s\n", hostname, client->nick,
- // channel->name, channel->member_count, channel->topic ? channel->topic : "");
- copy_strf(&databuf, ":%s 322 %s %s 0 :%s\n", hostname, client->nick,
- channel->name, channel->topic ? channel->topic : "");
+ copy_strf(&databuf, ":%s 322 %s %s %u :%s\n", hostname, client->nick,
+ chan->name, chan->member_count, chan->topic ? chan->topic : "");
send_log(client->FD, databuf.buf, databuf.len, 0);
} while(trie_findnext(&f) == 1);
copy_strf(&databuf, ":%s 323 %s :End of /LIST\n", hostname, client->nick);
send_log(client->FD, databuf.buf, databuf.len, 0);
copy_strf(&databuf, ":%s 004 %s PatchyIRCD 0.0.1 i nt\n", hostname, client->nick);
send_log(client->FD, databuf.buf, databuf.len, 0);
- // FIXME: output nicklen from the actual macro
- copy_strf(&databuf, ":%s 005 %s CASEMAPPING=rfc1459 NICKLEN=31 CHANTYPES=#& PREFIX=(ov)@+ :are supported by this server\n", hostname, client->nick);
+ copy_strf(&databuf, ":%s 005 %s CASEMAPPING=rfc1459 NICKLEN=%u CHANTYPES=#& PREFIX=(ov)@+ :are supported by this server\n", hostname, client->nick, MAX_NICKLEN-1);
send_log(client->FD, databuf.buf, databuf.len, 0);
copy_strf(&databuf, ":%s 251 %s :This server exists\n", hostname, client->nick);
send_log(client->FD, databuf.buf, databuf.len, 0);
if (chan->topic) {
copy_strf(&databuf, ":%s 332 %s %s :%s\n", hostname, client->nick, chan->name, chan->topic);
send_log(client->FD, databuf.buf, databuf.len, 0);
- // FIXME: needs %d
- //copy_strf(&databuf, ":%s 333 %s %s %s %d\n", hostname, client->nick, chan->name, chan->topic_who, chan->topic_when);
- copy_strf(&databuf, ":%s 333 %s %s %s 0\n", hostname, client->nick, chan->name, chan->topic_who);
+ copy_strf(&databuf, ":%s 333 %s %s %s %u\n", hostname, client->nick, chan->name, chan->topic_who, (unsigned)chan->topic_when);
send_log(client->FD, databuf.buf, databuf.len, 0);
} else if (!joining) {
copy_strf(&databuf, ":%s 331 %s %s :No topic is set\n", hostname, client->nick, chan->name);