# HG changeset patch # User Mark Doliner # Date 1298015503 0 # Node ID 43f661bc82ed6c9ccceb8849085e4f85c768b30d # Parent cb04febce5e42a278384b044856d1b45433f49a7 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(-) diff -r cb04febce5e4 -r 43f661bc82ed pidgin/gtkconv.c --- a/pidgin/gtkconv.c Fri Feb 18 02:54:38 2011 +0000 +++ b/pidgin/gtkconv.c Fri Feb 18 07:51:43 2011 +0000 @@ -141,8 +141,6 @@ 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 @@ } } -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 @@ 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 @@ 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);