From 02bb9db2edd535036e030e004a58ed1459c15bb8 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 29 Aug 2010 11:39:27 +0200 Subject: Handle payloads attached to errors (assume any number in cmd[2] would be a payload length, which seems like a fair assumption). This should solve problems with logging in with dodgy contact/membership lists. --- protocols/msn/ns.c | 4 ++++ protocols/nogaim.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index bd13c3a6..fa445aa7 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -518,6 +518,10 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) imc_logout( ic, TRUE ); return( 0 ); } + + /* Oh yes, errors can have payloads too now. Discard them for now. */ + if( num_parts >= 3 ) + md->handler->msglen = atoi( cmd[2] ); } else { diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 10ffd843..aa3ad5bb 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -251,7 +251,7 @@ void imcb_error( struct im_connection *ic, char *format, ... ) if( ic->flags & OPT_LOGGED_IN ) serv_got_crap( ic, "Error: %s", text ); else - serv_got_crap( ic, "Couldn't log in: %s", text ); + serv_got_crap( ic, "Login error: %s", text ); g_free( text ); } -- cgit v1.2.3