diff libpurple/protocols/myspace/myspace.h @ 17269:57bde8784308

(Plugin loads, but cannot do anything useful) Forward-declare _MsimSession structure and remove session.h. This now allows the plugin to load correctly by Pidgin, as it finds the purple_init_plugin symbol. Previous revision could be loaded because this symbol could not be found. Conversion to use MsimMessage for receiving messages is incomplete, and therefore this plugin cannot be used for anything useful (login fails with "Unparseable message" from server.)
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Fri, 01 Jun 2007 04:47:25 +0000
parents 793301c04e3a
children f3ec513efb59
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.h	Thu May 31 06:09:46 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Fri Jun 01 04:47:25 2007 +0000
@@ -49,7 +49,6 @@
 
 
 /* MySpaceIM includes */
-#include "session.h"
 #include "message.h"
 
 /* Conditional compilation options */
@@ -95,6 +94,32 @@
 /* Authentication algorithm for login2 */
 #define MSIM_AUTH_ALGORITHM	196610
 
+/* Random number in every MsimSession, to ensure it is valid. */
+#define MSIM_SESSION_STRUCT_MAGIC       0xe4a6752b
+
+/* Everything needed to keep track of a session. */
+typedef struct _MsimSession
+{
+    guint magic;                        /**< MSIM_SESSION_STRUCT_MAGIC */
+    PurpleAccount *account;
+    PurpleConnection *gc;
+    gchar *sesskey;                     /**< Session key text string from server */
+    gchar *userid;                      /**< This user's numeric user ID */
+    gint fd;                            /**< File descriptor to/from server */
+
+    GHashTable *user_lookup_cb;         /**< Username -> userid lookup callback */
+    GHashTable *user_lookup_cb_data;    /**< Username -> userid lookup callback data */
+    GHashTable *user_lookup_cache;      /**< Cached information on users */
+
+    gchar *rxbuf;                       /**< Receive buffer */
+    guint rxoff;                        /**< Receive buffer offset */
+	guint next_rid;						/**< Next request/response ID */
+} MsimSession;
+
+/* Check if an MsimSession is valid */
+#define MSIM_SESSION_VALID(s) (session != NULL && \
+		session->magic == MSIM_SESSION_STRUCT_MAGIC)
+
 /* Callback function pointer type for when a user's information is received, 
  * initiated from a user lookup. */
 typedef void (*MSIM_USER_LOOKUP_CB)(MsimSession *session, GHashTable *userinfo,