Mercurial > pidgin
changeset 17297:c2208b64bffb
Change MsimSession.sesskey to an integer (used to be a string), now that
we have MsimMessage to handle parsing/packing integer fields for us.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Sun, 03 Jun 2007 05:50:11 +0000 |
parents | 1905859d7a3b |
children | 9c5b1dc7404f |
files | libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h |
diffstat | 2 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c Sun Jun 03 04:50:35 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Sun Jun 03 05:50:11 2007 +0000 @@ -651,7 +651,7 @@ return msim_send(session, "bm", MSIM_TYPE_INTEGER, MSIM_BM_INSTANT, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, "t", MSIM_TYPE_STRING, g_strdup(userid), "cv", MSIM_TYPE_INTEGER, MSIM_CLIENT_VERSION, "msg", MSIM_TYPE_STRING, g_strdup(message), @@ -846,8 +846,8 @@ purple_connection_update_progress(gc, _("Connected"), 3, 4); /* Freed in msim_session_destroy */ - session->sesskey = msim_msg_get_string(msg, "sesskey"); - purple_debug_info("msim", "SESSKEY=<%s>\n", session->sesskey); + session->sesskey = msim_msg_get_integer(msg, "sesskey"); + purple_debug_info("msim", "SESSKEY=<%d>\n", session->sesskey); /* Comes with: proof,profileid,userid,uniquenick -- all same values * (at least for me). */ @@ -1178,7 +1178,7 @@ if (!msim_send(session, "addbuddy", MSIM_TYPE_BOOLEAN, TRUE, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, /* Currently only allow numeric ID. TODO: Lookup username/email to uid. */ "newprofileid", MSIM_TYPE_STRING, g_strdup(buddy->name), "reason", MSIM_TYPE_STRING, g_strdup(""), @@ -1192,7 +1192,7 @@ if (!msim_send(session, "persist", MSIM_TYPE_INTEGER, 1, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, "cmd", MSIM_TYPE_INTEGER, MSIM_CMD_BIT_ACTION | MSIM_CMD_PUT, "dsn", MSIM_TYPE_INTEGER, MC_CONTACT_INFO_DSN, "lid", MSIM_TYPE_INTEGER, MC_CONTACT_INFO_LID, @@ -1222,7 +1222,7 @@ if (!msim_send(session, "delbuddy", MSIM_TYPE_BOOLEAN, TRUE, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, /* TODO: Lookup username/email to uid, currently on userid. */ "delprofileid", MSIM_TYPE_STRING, g_strdup(buddy->name), NULL)) @@ -1233,7 +1233,7 @@ if (!msim_send(session, "persist", MSIM_TYPE_INTEGER, 1, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, "cmd", MSIM_TYPE_INTEGER, MSIM_CMD_BIT_ACTION | MSIM_CMD_DELETE, "dsn", MSIM_TYPE_INTEGER, MD_DELETE_BUDDY_DSN, "lid", MSIM_TYPE_INTEGER, MD_DELETE_BUDDY_LID, @@ -1464,7 +1464,6 @@ g_free(session->rxbuf); g_free(session->userid); - g_free(session->sesskey); g_free(session); } @@ -1580,7 +1579,7 @@ g_return_if_fail(msim_send(session, "persist", MSIM_TYPE_INTEGER, 1, - "sesskey", MSIM_TYPE_STRING, g_strdup(session->sesskey), + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, "cmd", MSIM_TYPE_INTEGER, 1, "dsn", MSIM_TYPE_INTEGER, dsn, "uid", MSIM_TYPE_STRING, g_strdup(session->userid),
--- a/libpurple/protocols/myspace/myspace.h Sun Jun 03 04:50:35 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Sun Jun 03 05:50:11 2007 +0000 @@ -113,7 +113,7 @@ guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */ PurpleAccount *account; PurpleConnection *gc; - gchar *sesskey; /**< Session key text string from server */ + guint sesskey; /**< Session key from server */ gchar *userid; /**< This user's numeric user ID */ gint fd; /**< File descriptor to/from server */