# HG changeset patch # User Jeffrey Connelly # Date 1178254141 0 # Node ID 3b5037a93807c52f6ceb33ca0f00a135afd7ccd8 # Parent ba7d6317da7668590d48f9146957a2a93fa54e20 Add initializers for reserved fields in plugin and prpl structures. Change msim_send to msim_send_raw and add an empty msim_send for later. diff -r ba7d6317da76 -r 3b5037a93807 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Tue May 01 04:09:37 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Fri May 04 04:49:01 2007 +0000 @@ -351,16 +351,15 @@ #endif /** - * Send an arbitrary protocol message. + * Send raw data to the server. * * @param session - * @param msg The textual, packed message to send. + * @param msg The raw data to send. * * @return TRUE if succeeded, FALSE if not. * - * Note: this does not send instant messages. For that, see msim_send_im. */ -static gboolean msim_send(MsimSession *session, const gchar *msg) +static gboolean msim_send_raw(MsimSession *session, const gchar *msg) { int total_bytes_sent, total_bytes; @@ -381,7 +380,7 @@ if (bytes_sent < 0) { - purple_debug_info("msim", "msim_send(%s): send() failed: %s\n", + purple_debug_info("msim", "msim_send_raw(%s): send() failed: %s\n", msg, g_strerror(errno)); return FALSE; } @@ -391,6 +390,17 @@ return TRUE; } +/** + * Send a message to the server. + * + * @param session + * @param ... A sequence of gchar* key/value pairs, terminated with NULL + */ +static gboolean msim_send(MsimSession *session, ...) +{ + /* TODO: implement this */ +} + /** * Start logging in to the MSIM servers. * @@ -487,7 +497,7 @@ purple_debug_info("msim", "response=<%s>\n", buf); - msim_send(session, buf); + msim_send_raw(session, buf); g_free(buf); @@ -713,11 +723,11 @@ session->sesskey, userid, MSIM_CLIENT_VERSION, message); /* XXX: delete after escape each value */ - g_free(message); + g_free((char*)message); purple_debug_info("msim", "going to write: %s\n", msg_string); - msim_send(session, msg_string); + msim_send_raw(session, msg_string); /* TODO: notify Purple that we sent the IM. */ @@ -1465,7 +1475,7 @@ msg_string = g_strdup_printf("\\persist\\1\\sesskey\\%s\\cmd\\1\\dsn\\%d\\uid\\%s\\lid\\%d\\rid\\%d\\body\\%s=%s\\final\\", session->sesskey, dsn, session->userid, lid, rid, field_name, user); - msim_send(session, msg_string); + msim_send_raw(session, msg_string); } @@ -1605,7 +1615,11 @@ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ NULL, /* send_raw */ - NULL /* roomlist_room_serialize */ + NULL, /* roomlist_room_serialize */ + NULL, /* _purple_reserved1 */ + NULL, /* _purple_reserved2 */ + NULL, /* _purple_reserved3 */ + NULL /* _purple_reserved4 */ }; @@ -1640,7 +1654,12 @@ NULL, /**< prefs_info */ /* msim_actions */ - NULL + NULL, + + NULL, /**< reserved1 */ + NULL, /**< reserved2 */ + NULL, /**< reserved3 */ + NULL /**< reserved4 */ }; diff -r ba7d6317da76 -r 3b5037a93807 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Tue May 01 04:09:37 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Fri May 04 04:49:01 2007 +0000 @@ -105,7 +105,8 @@ static GHashTable *msim_parse_body(const gchar *body_str); static void print_hash_item(gpointer key, gpointer value, gpointer user_data); -static gboolean msim_send(MsimSession *session, const gchar *msg); +static gboolean msim_send_raw(MsimSession *session, const gchar *msg); +static gboolean msim_send(MsimSession *session, ...); static void msim_login(PurpleAccount *acct); static int msim_login_challenge(MsimSession *session, GHashTable *table);