From 60c235bccc2d7262072fcd17747ac87fbd6d9547 Mon Sep 17 00:00:00 2001 From: Mark Doliner Date: Fri, 18 Feb 2011 07:51:43 +0000 Subject: [PATCH] Fixes this crash: 1. Open an IM window with someone who has just gone online or offline 2. Delete your account from the Accounts window 3. Wait for the 11 second timer to trigger The conversation code was setting an 11 second timer when a buddy signs online or offline so that it could stop showing the open door or close door icon for the buddy, similar to what we do in the buddy list. However, we didn't keep track of the handle for this timer and didn't clear it if the account is deleted--thus the crash. I noticed that we don't currently show the open door or close door icons in the conversation window. I think it would be good if we did... but I don't think the gtkconv code should keep track of this information. gtkblist.c already keeps track of it in gtknode->recent_signonoff_timer. We should either re-use that, or better yet, we should add "recent signon" and "recent signoff" states to the status system somehow. But I don't feel like working on that... it's pretty minor. In any case I don't think this code is the right way to handle it, so I'm getting rid of it. Feel free to disapprove this if you disagree! (But also please fix the crash, maybe just by disabling the timer for now) I'm also getting rid of the login_list and logout_list lists, since they're not used. 1 file changed, 33 deletions(-) --HG-- extra : convert_revision : d79cb15140c8920bdfba4a1dbe9768c2022644c7 --- pidgin/gtkconv.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c index 7ca0574913..7070e9d8e7 100644 --- a/pidgin/gtkconv.c +++ b/pidgin/gtkconv.c @@ -141,8 +141,6 @@ static GList *available_list = NULL; static GList *away_list = NULL; static GList *busy_list = NULL; static GList *xa_list = NULL; -static GList *login_list = NULL; -static GList *logout_list = NULL; static GList *offline_list = NULL; static GHashTable *prpl_lists = NULL; @@ -7567,33 +7565,11 @@ account_signing_off(PurpleConnection *gc) } } -struct _status_timeout_user { - gchar *name; - PurpleAccount *account; -}; - -static gboolean -update_buddy_status_timeout(struct _status_timeout_user *user) -{ - /* To remove the signing-on/off door icon */ - PurpleConversation *conv; - - conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, user->name, user->account); - if (conv) - pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON); - - g_free(user->name); - g_free(user); - - return FALSE; -} - static void update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus) { PidginConversation *gtkconv; PurpleConversation *conv; - struct _status_timeout_user *user; gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy)); if (gtkconv) @@ -7605,13 +7581,6 @@ update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus if ((purple_status_is_online(old) ^ purple_status_is_online(newstatus)) != 0) pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU); } - - user = g_malloc(sizeof(struct _status_timeout_user)); - user->name = g_strdup(buddy->name); - user->account = buddy->account; - - /* In case a conversation is started after the buddy has signed-on/off */ - purple_timeout_add_seconds(11, (GSourceFunc)update_buddy_status_timeout, user); } static void @@ -9156,8 +9125,6 @@ create_icon_lists(GtkWidget *w) available_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AVAILABLE, w); busy_list = make_status_icon_list(PIDGIN_STOCK_STATUS_BUSY, w); xa_list = make_status_icon_list(PIDGIN_STOCK_STATUS_XA, w); - login_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGIN, w); - logout_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGOUT, w); offline_list = make_status_icon_list(PIDGIN_STOCK_STATUS_OFFLINE, w); away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w); prpl_lists = g_hash_table_new(g_str_hash, g_str_equal); -- 2.11.4.GIT