1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

irc: add variables "user_max_length" and "host_max_length" in server structure (issue #1387)

This commit is contained in:
Sébastien Helleu
2019-08-04 14:10:14 +02:00
parent 4fa62a83f1
commit 0bf5a5ae9c
5 changed files with 81 additions and 0 deletions
+32
View File
@@ -2944,6 +2944,38 @@ IRC_PROTOCOL_CALLBACK(005)
pos2[0] = ' ';
}
/* save max user length */
pos = strstr (argv_eol[3], "USERLEN=");
if (pos)
{
pos += 8;
pos2 = strchr (pos, ' ');
if (pos2)
pos2[0] = '\0';
error = NULL;
value = strtol (pos, &error, 10);
if (error && !error[0] && (value > 0))
server->user_max_length = (int)value;
if (pos2)
pos2[0] = ' ';
}
/* save max host length */
pos = strstr (argv_eol[3], "HOSTLEN=");
if (pos)
{
pos += 8;
pos2 = strchr (pos, ' ');
if (pos2)
pos2[0] = '\0';
error = NULL;
value = strtol (pos, &error, 10);
if (error && !error[0] && (value > 0))
server->host_max_length = (int)value;
if (pos2)
pos2[0] = ' ';
}
/* save casemapping */
pos = strstr (argv_eol[3], "CASEMAPPING=");
if (pos)