changeset 17326: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 c4bd017a825e
files libpurple/protocols/myspace/message.h libpurple/protocols/myspace/myspace.h libpurple/protocols/myspace/session.h
diffstat 3 files changed, 30 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.h	Thu May 31 06:09:46 2007 +0000
+++ b/libpurple/protocols/myspace/message.h	Fri Jun 01 04:47:25 2007 +0000
@@ -24,8 +24,6 @@
 
 #include <glib.h>
 
-#include "session.h"
-
 /* Types */
 #define MsimMessage GList		/* #define instead of typedef to avoid casting */
 typedef struct _MsimMessageElement
@@ -51,7 +49,10 @@
 gchar *msim_msg_debug_string(MsimMessage *msg);
 gchar *msim_msg_pack(MsimMessage *msg);
 
-gboolean msim_msg_send(MsimSession *session, MsimMessage *msg);
+/* Defined in myspace.h */
+struct _MsimSession;
+
+gboolean msim_msg_send(struct _MsimSession *session, MsimMessage *msg);
 
 MsimMessage *msim_parse(gchar *raw);
 GHashTable *msim_parse_body(const gchar *body_str);
--- 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,
--- a/libpurple/protocols/myspace/session.h	Thu May 31 06:09:46 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* MySpaceIM Protocol Plugin, session header file
- *
- * \author Jeff Connelly
- *
- * Copyright (C) 2007, Jeff Connelly <jeff2@homing.pidgin.im>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _MYSPACE_SESSION_H
-#define _MYSPACE_SESSION_H
-
-#include <glib.h>
-
-#include "account.h"
-
-/* 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)
-
-#endif /* !_MYSPACE_SESSION_H */