pidgin: 5440ca52: Add an FQY error handler so we don't dis...

qulogic at pidgin.im qulogic at pidgin.im
Sat May 2 19:15:39 EDT 2009


-----------------------------------------------------------------
Revision: 5440ca529821d13803048bf7a1985cf02e4f8977
Ancestor: 54f9b89abccda90d90bcd15d12fd091279a7f54e
Author: qulogic at pidgin.im
Date: 2009-05-02T22:31:13
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5440ca529821d13803048bf7a1985cf02e4f8977

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

ChangeLog: 

Add an FQY error handler so we don't disconnect if something incorrect was
sent (unless the server kicked us itself).

References #8588.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	90219dc821aecd41418629a63a19ba6c45e6cbdc
+++ libpurple/protocols/msn/notification.c	328f5b50cc282fda66948c8dea96a9ac8cdd0261
@@ -914,6 +914,26 @@ static void
 }
 
 static void
+fqy_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
+{
+	purple_debug_warning("msn", "FQY error %d: %s\n",
+	                     GPOINTER_TO_INT(cmd->payload_cbdata), payload);
+}
+
+static void
+fqy_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
+{
+	MsnCommand *cmd = cmdproc->last_cmd;
+
+	purple_debug_error("msn", "FQY error %d\n", error);
+	if (cmd->param_count > 1) {
+		cmd->payload_cb = fqy_error_parse;
+		cmd->payload_len = atoi(cmd->params[1]);
+		cmd->payload_cbdata = GINT_TO_POINTER(error);
+	}
+}
+
+static void
 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
 			 size_t len)
 {
@@ -2153,6 +2173,7 @@ msn_notification_init(void)
 
 	msn_table_add_error(cbs_table, "ADD", add_error);
 	msn_table_add_error(cbs_table, "ADL", adl_error);
+	msn_table_add_error(cbs_table, "FQY", fqy_error);
 	msn_table_add_error(cbs_table, "REG", reg_error);
 	msn_table_add_error(cbs_table, "RMG", rmg_error);
 	msn_table_add_error(cbs_table, "USR", usr_error);


More information about the Commits mailing list