# HG changeset patch # User Jeffrey Connelly # Date 1183595365 0 # Node ID 3aed9c8c6af73f23974e8e1ced29308424a487a0 # Parent b9fd559039794f0629a2b62c93abb65e565938fc Fix bug where string returned from msim_msg_get_string() is not a new string if the data type is a string (oops). This fixes the get info crash on Windows. diff -r b9fd55903979 -r 3aed9c8c6af7 libpurple/protocols/myspace/message.c --- a/libpurple/protocols/myspace/message.c Wed Jul 04 22:48:52 2007 +0000 +++ b/libpurple/protocols/myspace/message.c Thu Jul 05 00:29:25 2007 +0000 @@ -834,7 +834,7 @@ case MSIM_TYPE_STRING: /* Already unescaped. */ - return (gchar *)elem->data; + return g_strdup((gchar *)elem->data); default: purple_debug_info("msim", "msim_msg_get_string: type %d unknown, name %s\n", diff -r b9fd55903979 -r 3aed9c8c6af7 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Wed Jul 04 22:48:52 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Thu Jul 05 00:29:25 2007 +0000 @@ -1102,8 +1102,8 @@ return; } + msim_msg_free(msg); purple_debug_info("msim", "msim_get_info_cb: got for user: %s\n", user); - msim_msg_free(msg); body_str = msim_msg_get_string(user_info_msg, "body"); g_return_if_fail(body_str != NULL); @@ -1117,7 +1117,7 @@ user_info = purple_notify_user_info_new(); /* Identification */ - purple_notify_user_info_add_pair(user_info, _("User"), g_strdup(user)); + purple_notify_user_info_add_pair(user_info, _("User"), user); /* note: g_hash_table_lookup does not create a new string! */ str = g_hash_table_lookup(body, "UserID"); diff -r b9fd55903979 -r 3aed9c8c6af7 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Wed Jul 04 22:48:52 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Thu Jul 05 00:29:25 2007 +0000 @@ -88,7 +88,7 @@ #define MSIM_PORT 1863 /* TODO: alternate ports and automatic */ /* Time between keepalives (seconds) - if no data within this time, is dead. */ -#define MSIM_KEEPALIVE_INTERVAL (2 * 60) +#define MSIM_KEEPALIVE_INTERVAL (3 * 60) /* Time to check if alive (milliseconds) */ #define MSIM_KEEPALIVE_INTERVAL_CHECK (30 * 1000)