# HG changeset patch # User Sadrul Habib Chowdhury # Date 1196813800 0 # Node ID 7697b246fbcc4fa542f05daae53995b376b9a4f8 # Parent e8e9a53b769448cc768a678f4508dc2455793617# Parent 21371ea859703035c58c3be4516dc4886c376d14 merge of '024dfe71422830dbaef95d94fd32517d86c82eb3' and '53558acaab3e3ec1ac0d96de3aca88b017340724' diff -r e8e9a53b7694 -r 7697b246fbcc pidgin/gtkblist.c --- a/pidgin/gtkblist.c Wed Dec 05 00:03:11 2007 +0000 +++ b/pidgin/gtkblist.c Wed Dec 05 00:16:40 2007 +0000 @@ -4097,7 +4097,7 @@ PurpleConversation *conv, PurpleMessageFlags flag, PurpleBlistNode *node) { PidginBlistNode *ui = node->ui_data; - if (ui->conv.conv != conv || PIDGIN_CONVERSATION(conv) || + if (ui->conv.conv != conv || !pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv)) || !(flag & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))) return; ui->conv.flags |= PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE; @@ -4106,11 +4106,10 @@ } static void -displayed_msg_update_ui_cb(PurpleAccount *account, const char *who, const char *message, - PurpleConversation *conv, PurpleMessageFlags flag, PurpleBlistNode *node) +displayed_msg_update_ui_cb(PidginConversation *gtkconv, PurpleBlistNode *node) { PidginBlistNode *ui = node->ui_data; - if (ui->conv.conv != conv) + if (ui->conv.conv != gtkconv->active_conv) return; ui->conv.flags &= ~PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE; pidgin_blist_update(purple_get_blist(), node); @@ -4136,10 +4135,11 @@ ui, PURPLE_CALLBACK(conversation_deleted_update_ui_cb), ui); purple_signal_connect(purple_conversations_get_handle(), "wrote-im-msg", ui, PURPLE_CALLBACK(written_msg_update_ui_cb), buddy); - purple_signal_connect(pidgin_conversations_get_handle(), "displayed-im-msg", + purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", ui, PURPLE_CALLBACK(displayed_msg_update_ui_cb), buddy); } } + break; case PURPLE_CONV_TYPE_CHAT: { PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name); @@ -4156,9 +4156,10 @@ ui, PURPLE_CALLBACK(conversation_deleted_update_ui_cb), ui); purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", ui, PURPLE_CALLBACK(written_msg_update_ui_cb), chat); - purple_signal_connect(pidgin_conversations_get_handle(), "displayed-chat-msg", + purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", ui, PURPLE_CALLBACK(displayed_msg_update_ui_cb), chat); } + break; default: break; } @@ -5967,7 +5968,8 @@ ui = node->ui_data; conv = ui->conv.conv; - hidden = (conv && (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE)); + hidden = (conv && (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE) && + pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv))); status = pidgin_blist_get_status_icon(node, biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); diff -r e8e9a53b7694 -r 7697b246fbcc pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Dec 05 00:03:11 2007 +0000 +++ b/pidgin/gtkconv.c Wed Dec 05 00:16:40 2007 +0000 @@ -5093,7 +5093,7 @@ !purple_status_is_available(purple_account_get_active_status(account))) hide = TRUE; - if (PIDGIN_IS_PIDGIN_CONVERSATION(conv) && !hide) { + if (conv && PIDGIN_IS_PIDGIN_CONVERSATION(conv) && !hide) { PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); if (gtkconv->win == hidden_convwin) { pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv); @@ -6638,7 +6638,6 @@ unseen = PIDGIN_UNSEEN_TEXT; conv_set_unseen(conv, unseen); - purple_conversation_update(conv, PURPLE_CONV_UPDATE_UNSEEN); } } @@ -7495,6 +7494,8 @@ return FALSE; pidgin_conv_window_remove_gtkconv(hidden_convwin, gtkconv); pidgin_conv_placement_place(gtkconv); + purple_signal_emit(pidgin_conversations_get_handle(), + "conversation-displayed", gtkconv); return TRUE; } @@ -7714,17 +7715,17 @@ purple_value_new(PURPLE_TYPE_INT)); purple_signal_register(handle, "conversation-switched", - purple_marshal_VOID__POINTER_POINTER, NULL, 1, + purple_marshal_VOID__POINTER, NULL, 1, purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONVERSATION)); purple_signal_register(handle, "conversation-hiding", - purple_marshal_VOID__POINTER_POINTER, NULL, 1, + purple_marshal_VOID__POINTER, NULL, 1, purple_value_new(PURPLE_TYPE_BOXED, "PidginConversation *")); purple_signal_register(handle, "conversation-displayed", - purple_marshal_VOID__POINTER_POINTER, NULL, 1, + purple_marshal_VOID__POINTER, NULL, 1, purple_value_new(PURPLE_TYPE_BOXED, "PidginConversation *"));