diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-12-18 13:43:01 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-12-18 13:43:01 -0300 |
commit | 014b242df803089c34084de3d806a7c4e4dad75e (patch) | |
tree | 12dd5534a445fedc63b8219e48951bff0b3d2283 /src/common/inbound.c | |
parent | d049be950cfaca6311b575890e81521d62db68d7 (diff) | |
parent | bb7a03e9f68a775ca93dd6ad8ea61e4f1d2ba81b (diff) |
Merge remote-tracking branch 'upstream/master' into default
Diffstat (limited to 'src/common/inbound.c')
-rw-r--r-- | src/common/inbound.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c index 3c505a57..a591dc48 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1474,10 +1474,17 @@ inbound_user_info (session *sess, char *chan, char *user, char *host, for (list = sess_list; list; list = list->next) { sess = list->data; - if (sess->type == SESS_CHANNEL && sess->server == serv) + if (sess->server != serv) + continue; + + if (sess->type == SESS_CHANNEL) { userlist_add_hostname (sess, nick, uhost, realname, servname, account, away); } + else if (sess->type == SESS_DIALOG && uhost && !serv->p_cmp (sess->channel, nick)) + { + set_topic (sess, uhost, uhost); + } } } @@ -1728,6 +1735,7 @@ static const char * const supported_caps[] = { "setname", "invite-notify", "account-tag", + "extended-monitor", /* ZNC */ "znc.in/server-time-iso", @@ -1929,7 +1937,24 @@ inbound_sasl_authenticate (server *serv, char *data) return; } - tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass); + /* long SASL passwords must be split into 400-byte chunks + https://ircv3.net/specs/extensions/sasl-3.1#the-authenticate-command */ + size_t pass_len = strlen (pass); + if (pass_len <= 400) + tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass); + else + { + size_t sent = 0; + while (sent < pass_len) + { + char *pass_chunk = g_strndup (pass + sent, 400); + tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass_chunk); + sent += 400; + g_free (pass_chunk); + } + } + if (pass_len % 400 == 0) + tcp_sendf (serv, "AUTHENTICATE +\r\n"); g_free (pass); |