pidgin/pidgin

86e7c9ca0bcd
Parents d184ca7f413e
Children c2f032e8ec1e
irc: handle AUTHENTICATE as a normal command with server prefix

The previous code expected it to be at the beginning of the line with no
:prefix. Probably because the sasl-3.1 spec gave examples that way.
This adds it as a normal command handler as it should have been since the
beginning. Fixes login to oragono servers.

Don't know if the signature of irc_msg_auth() is API so did it the safe way.
--- a/libpurple/protocols/irc/irc.h Mon Mar 05 02:41:47 2018 -0300
+++ b/libpurple/protocols/irc/irc.h Mon Mar 05 02:58:42 2018 -0300
@@ -187,6 +187,7 @@
#ifdef HAVE_CYRUS_SASL
void irc_msg_cap(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_auth(struct irc_conn *irc, char *arg);
+void irc_msg_authenticate(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_authok(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_authtryagain(struct irc_conn *irc, const char *name, const char *from, char **args);
void irc_msg_authfail(struct irc_conn *irc, const char *name, const char *from, char **args);
--- a/libpurple/protocols/irc/msgs.c Mon Mar 05 02:41:47 2018 -0300
+++ b/libpurple/protocols/irc/msgs.c Mon Mar 05 02:58:42 2018 -0300
@@ -1700,6 +1700,12 @@
}
void
+irc_msg_authenticate(struct irc_conn *irc, const char *name, const char *from, char **args)
+{
+ irc_msg_auth(irc, args[0]);
+}
+
+void
irc_msg_authok(struct irc_conn *irc, const char *name, const char *from, char **args)
{
char *buf;
--- a/libpurple/protocols/irc/parse.c Mon Mar 05 02:41:47 2018 -0300
+++ b/libpurple/protocols/irc/parse.c Mon Mar 05 02:58:42 2018 -0300
@@ -115,6 +115,7 @@
{ "906", "*", 0, irc_msg_authfail }, /* SASL auth failed */
{ "907", "*", 0, irc_msg_authfail }, /* SASL auth failed */
{ "cap", "vv:", 3, irc_msg_cap }, /* SASL capable */
+ { "authenticate", ":", 1, irc_msg_authenticate }, /* SASL authenticate */
#endif
{ "invite", "n:", 2, irc_msg_invite }, /* Invited */
{ "join", ":", 1, irc_msg_join }, /* Joined a channel */