changeset 20984:5699d5cb0028

merge of '3bee1aee40b5389caacd65f686618708d5bc65c8' and '82743a9bd82c2c23498b62d3532151dd6b5b8c77'
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 18 Oct 2007 14:37:23 +0000
parents aee8d876fed1 (diff) 64644b98c20c (current diff)
children 3a09d63e0c83
files
diffstat 6 files changed, 30 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Wed Oct 17 18:20:41 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Thu Oct 18 14:37:23 2007 +0000
@@ -935,7 +935,6 @@
 	gchar *username;
 	PurpleNotifyUserInfo *user_info;
 	MsimUser *user;
-	gboolean temporary_user;
 
 	g_return_if_fail(MSIM_SESSION_VALID(session));
 
@@ -957,10 +956,14 @@
 
 	if (!user) {
 		/* User isn't on blist, create a temporary user to store info. */
-		temporary_user = TRUE;
+		PurpleBuddy *buddy;
+
 		user = g_new0(MsimUser, 1);
-	} else {
-		temporary_user = FALSE;
+		user->temporary_user = TRUE;
+
+		buddy = purple_buddy_new(session->account, username, NULL);
+		user->buddy = buddy;
+		buddy->proto_data = (gpointer)user;
 	}
 
 	/* Update user structure with new information */
@@ -976,7 +979,8 @@
 
 	purple_notify_user_info_destroy(user_info);
 
-	if (temporary_user) {
+	if (user->temporary_user) {
+		purple_blist_remove_buddy(user->buddy);
 		g_free(user->client_info);
 		g_free(user->gender);
 		g_free(user->location);
@@ -1452,7 +1456,7 @@
 	purple_debug_info("msim", "data=%s\n", data->str
 			? data->str : "(NULL)");
 
-	/* url_text is variable=data\n... */
+	/* url_text is variable=data\n...†*/
 
 	/* Check FILEVER, 1.0.716.0. 716 is build, MSIM_CLIENT_VERSION */
 	/* New (english) version can be downloaded from SETUPURL+SETUPFILE */
--- a/libpurple/protocols/myspace/user.c	Wed Oct 17 18:20:41 2007 +0000
+++ b/libpurple/protocols/myspace/user.c	Thu Oct 18 14:37:23 2007 +0000
@@ -99,10 +99,12 @@
 
 	if (full) {
 		/* TODO: link to username, if available */
-		char *profile = g_strdup_printf("<a href=\"http://myspace.com/%d\">http://myspace.com/%d</a>",
-				uid, uid);
-		purple_notify_user_info_add_pair(user_info, _("Profile"), profile);
-		g_free(profile);
+		if (uid) {
+			char *profile = g_strdup_printf("<a href=\"http://myspace.com/%d\">http://myspace.com/%d</a>",
+											uid, uid);
+			purple_notify_user_info_add_pair(user_info, _("Profile"), profile);
+			g_free(profile);
+		}
 	}
 
 
@@ -201,6 +203,14 @@
 		/* Ignore because PurpleBuddy knows this already */
 		g_free(value_str);
 	} else if (g_str_equal(key_str, "ImageURL") || g_str_equal(key_str, "AvatarURL")) {
+		if (user->temporary_user) {
+			/* This user will be destroyed soon; don't try to look up its image or avatar, 
+			 * since that won't return immediately and we will end up accessing freed data.
+			 */
+			g_free(value_str);
+			return;
+		}
+		
 		const gchar *previous_url;
 
 		g_free(user->image_url);
--- a/libpurple/protocols/myspace/user.h	Wed Oct 17 18:20:41 2007 +0000
+++ b/libpurple/protocols/myspace/user.h	Thu Oct 18 14:37:23 2007 +0000
@@ -38,6 +38,7 @@
 	gchar *band_name, *song_name;
 	gchar *image_url;
 	guint last_image_updated;
+	gboolean temporary_user;
 } MsimUser;
 
 /* Callback function pointer type for when a user's information is received, 
--- a/pidgin/gtkblist.c	Wed Oct 17 18:20:41 2007 +0000
+++ b/pidgin/gtkblist.c	Thu Oct 18 14:37:23 2007 +0000
@@ -3987,7 +3987,7 @@
 
 			g_string_append_printf(tooltip_text,
 					ngettext("%d unread message from %s\n", "%d unread messages from %s\n", count),
-					count, purple_conversation_get_name(l->data));
+					count, purple_conversation_get_title(l->data));
 			l = l->next;
 		}
 		if(tooltip_text->len > 0) {
--- a/pidgin/gtkdocklet.c	Wed Oct 17 18:20:41 2007 +0000
+++ b/pidgin/gtkdocklet.c	Thu Oct 18 14:37:23 2007 +0000
@@ -154,13 +154,13 @@
 					g_string_append_printf(tooltip_text,
 						ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
 						gtkconv->unseen_count,
-						gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+						purple_conversation_get_title(conv));
 				} else {
 					g_string_append_printf(tooltip_text,
 						ngettext("%d unread message from %s\n", "%d unread messages from %s\n",
 						GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count"))),
 						GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count")),
-						purple_conversation_get_name(conv));
+						purple_conversation_get_title(conv));
 				}
 			}
 
--- a/pidgin/pixmaps/emotes/default/24/default.theme.in	Wed Oct 17 18:20:41 2007 +0000
+++ b/pidgin/pixmaps/emotes/default/24/default.theme.in	Thu Oct 18 14:37:23 2007 +0000
@@ -245,7 +245,7 @@
 music.png           [:-}
 laugh.png           *JOKINGLY*
 sleepy.png          *TIRED*
-crying.png          :'(
+crying.png          :'(    :'-(
 sick.png            :-!
 kissed.png          *KISSED*
 stop.png            *STOP*
@@ -259,7 +259,7 @@
 bomb.png            @=
 thinking.png        :-\\    :-/
 good.png            *THUMBS\ UP*
-shout.png           >:o     >:O
+shout.png           >:o     >:O     :-@
 beer.png            *DRINK*
 smile-big.png       :-D     :D
 glasses-cool.png    8-)