diff src/protocols/msn/transaction.h @ 10225:ecf3ce2e2ab1

[gaim-migrate @ 11357] This is mostly a patch from Felipe Contreras that eliminates MSN switchboard errors and fixes MSN buddy icon syncronization, with some tweaks by me. Thank Felipe if it works, blame me if something broke. I also fixed a couple of text markup escaping things, fixed a glib warning that was bugging me, fix a rare SILC crash, and make gtkstatusselector.c compile (but do nothing) with gtk < 2.4 committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 21 Nov 2004 17:48:09 +0000
parents ab6636c5a136
children f776e117c17b
line wrap: on
line diff
--- a/src/protocols/msn/transaction.h	Sun Nov 21 06:16:23 2004 +0000
+++ b/src/protocols/msn/transaction.h	Sun Nov 21 17:48:09 2004 +0000
@@ -30,28 +30,38 @@
 #include "cmdproc.h"
 
 typedef void (*MsnTransCb)(MsnCmdProc *cmdproc, MsnCommand *cmd);
+typedef void (*MsnTimeoutCb)(MsnCmdProc *cmdproc, MsnTransaction *trans);
+typedef void (*MsnErrorCb)(MsnCmdProc *cmdproc, MsnTransaction *trans,
+						   int error);
 
 /**
- * A transaction. A command that will initiate the transaction.
+ * A transaction. A sending command that will initiate the transaction.
  */
 struct _MsnTransaction
 {
+	MsnCmdProc *cmdproc;
 	unsigned int trId;
 
 	char *command;
 	char *params;
 
+	int timer;
+
+	void *data; /* The data to be used on the different callbacks */
 	GHashTable *callbacks;
-	void *data;
+	MsnErrorCb error_cb;
+	MsnTimeoutCb timeout_cb;
 
 	char *payload;
 	size_t payload_len;
 
 	GQueue *queue;
-	MsnCommand *pendent_cmd;
+	MsnCommand *pendent_cmd; /* The command that is waiting for the result of
+								this transaction. */
 };
 
-MsnTransaction *msn_transaction_new(const char *command,
+MsnTransaction *msn_transaction_new(MsnCmdProc *cmdproc,
+									const char *command,
 									const char *format, ...);
 void msn_transaction_destroy(MsnTransaction *trans);
 
@@ -62,6 +72,8 @@
 								 const char *payload, int payload_len);
 void msn_transaction_set_data(MsnTransaction *trans, void *data);
 void msn_transaction_add_cb(MsnTransaction *trans, char *answer,
-							MsnTransCb cb, void *data);
+							MsnTransCb cb);
+void msn_transaction_set_error_cb(MsnTransaction *trans, MsnErrorCb cb);
+void msn_transaction_set_timeout_cb(MsnTransaction *trans, MsnTimeoutCb cb);
 
 #endif /* _MSN_TRANSACTION_H */