CHANINFO is used by servers to inform each other about a channel:
its modes, channel key, user limits and its topic.
.
+ Note: even when <modes> don't include "k" (key) or "l" (limit), both
+ parameters must be given when used; use "*" for "no key" and 0 for
+ "no limit" for the unused parameter in this case.
+ .
The CHANINFO command is allowed on server-links only.
References:
static bool
Send_CHANINFO(CLIENT * Client, CHANNEL * Chan)
{
- char *modes, *topic;
+ char *modes, *topic, *key;
bool has_k, has_l;
#ifdef DEBUG
Channel_Name(Chan), modes, topic);
}
/* "CHANINFO <chan> +<modes> <key> <limit> :<topic>" */
+ key = Channel_Key(Chan);
return IRC_WriteStrClient(Client, "CHANINFO %s +%s %s %lu :%s",
Channel_Name(Chan), modes,
- has_k ? Channel_Key(Chan) : "*",
+ has_k ? (key && *key ? key : "*") : "*",
has_l ? Channel_MaxUsers(Chan) : 0, topic);
} /* Send_CHANINFO */