CL2CHAN *cl2chan;
CLIENT *cl;
char str[LINE_LEN], *ptr;
- bool njoin;
+ bool njoin, xop;
- if (Conn_Options(Client_Conn(Client)) & CONN_RFC1459)
- njoin = false;
- else
- njoin = true;
+ /* Check features of remote server */
+ njoin = Conn_Options(Client_Conn(Client)) & CONN_RFC1459 ? false : true;
+ xop = strchr(Client_Flags(Client), 'X') ? true : false;
/* Get all the members of this channel */
cl2chan = Channel_FirstMember(Chan);
assert(cl != NULL);
if (njoin) {
- /* RFC 2813: send NJOIN with nick names and modes
+ /* RFC 2813: send NJOIN with nicknames and modes
* (if user is channel operator or has voice) */
if (str[strlen(str) - 1] != ':')
strlcat(str, ",", sizeof(str));
- if (strchr(Channel_UserModes(Chan, cl), 'q'))
+
+ /* Prepare user prefix (ChanOp, voiced, ...) */
+ if (xop && strchr(Channel_UserModes(Chan, cl), 'q'))
strlcat(str, "~", sizeof(str));
- if (strchr(Channel_UserModes(Chan, cl), 'a'))
+ if (xop && strchr(Channel_UserModes(Chan, cl), 'a'))
strlcat(str, "&", sizeof(str));
if (strchr(Channel_UserModes(Chan, cl), 'o'))
strlcat(str, "@", sizeof(str));
- if (strchr(Channel_UserModes(Chan, cl), 'h'))
+ if (xop && strchr(Channel_UserModes(Chan, cl), 'h'))
strlcat(str, "%", sizeof(str));
if (strchr(Channel_UserModes(Chan, cl), 'v'))
strlcat(str, "+", sizeof(str));
if ((unsigned int)atol(value) == Conf_MaxNickLength - 1)
continue;
- /* Nick name length settings are different! */
+ /* Nickname length settings are different! */
Log(LOG_ERR,
- "Peer uses incompatible nick name length (%d/%d)! Disconnecting ...",
+ "Peer uses incompatible nickname length (%d/%d)! Disconnecting ...",
Conf_MaxNickLength - 1, atoi(value));
Conn_Close(Client_Conn(Client),
- "Incompatible nick name length",
+ "Incompatible nickname length",
NULL, false);
return DISCONNECTED;
}