pidgin: ba83d353: Apply khc's patch for ADL error 205, wit...

qulogic at pidgin.im qulogic at pidgin.im
Sun Oct 19 02:33:33 EDT 2008


-----------------------------------------------------------------
Revision: ba83d353849378608f614eb7900d63ebbcfdb50d
Ancestor: 7e6b96bf18be99338c17deae1128126df39d1a70
Author: qulogic at pidgin.im
Date: 2008-10-19T05:45:16
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ba83d353849378608f614eb7900d63ebbcfdb50d

Modified files:
        libpurple/protocols/msn/command.h
        libpurple/protocols/msn/notification.c

ChangeLog: 

Apply khc's patch for ADL error 205, with a few changes to get around 
string freeze. This should allow people to login for this release since 
I removed the previous workaround.

References #6640.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/command.h	b9b8a2de19d0682c75a6b999d2bb0d6826f4a24d
+++ libpurple/protocols/msn/command.h	3d1e3190fbcd9c861a284aff144b68e3832d7514
@@ -51,6 +51,7 @@ struct _MsnCommand
 	size_t payload_len;
 
 	MsnPayloadCb payload_cb;
+	void *payload_cbdata;
 };
 
 MsnCommand *msn_command_from_string(const char *string);
============================================================
--- libpurple/protocols/msn/notification.c	13464f9c93841f96a929fa1d5861379e11db0203
+++ libpurple/protocols/msn/notification.c	0b2fbde650541a21ed0d58237eefce2f3d952e80
@@ -753,21 +753,46 @@ static void
 }
 
 static void
+adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
+{
+	MsnSession *session;
+	PurpleAccount *account;
+	PurpleConnection *gc;
+	/*char *adl = g_strndup(payload, len);*/
+	char *reason = g_strdup_printf(_("Unknown error (%d)"),
+		GPOINTER_TO_INT(cmd->payload_cbdata)/*, adl*/);
+	/*g_free(adl);*/
+
+	session = cmdproc->session;
+	account = session->account;
+	gc = purple_account_get_connection(account);
+
+	purple_notify_error(gc, NULL, _("Unable to add user"), reason);
+	g_free(reason);
+}
+
+static void
 adl_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
 {
 	MsnSession *session;
 	PurpleAccount *account;
 	PurpleConnection *gc;
-	char *reason = NULL;
+	MsnCommand *cmd = cmdproc->last_cmd;
 
 	session = cmdproc->session;
 	account = session->account;
 	gc = purple_account_get_connection(account);
 
 	purple_debug_error("msn", "ADL error\n");
-	reason = g_strdup_printf(_("Unknown error (%d)"), error);
-	purple_notify_error(gc, NULL, _("Unable to add user"), reason);
-	g_free(reason);
+	if (cmd->param_count > 1) {
+		cmd->payload_cb = adl_error_parse;
+		cmd->payload_len = atoi(cmd->params[1]);
+		cmd->payload_cbdata = GINT_TO_POINTER(error);
+	} else {
+		char *reason = g_strdup_printf(_("Unknown error (%d)"), error);
+		purple_notify_error(gc, NULL, _("Unable to add user"), reason);
+		g_free(reason);
+	}
 }
 
 static void


More information about the Commits mailing list