# HG changeset patch # User Sadrul Habib Chowdhury # Date 1188583329 0 # Node ID 11de4598b4c53e1a659f4ec1a9c50a64f0855f1c # Parent 858d279314b2e341dbc5e180c9ec9af896b2a3ab Document the function to reattach conv-ui. Introduce the conversation-hiding and conversation-displayed signals in pidgin. diff -r 858d279314b2 -r 11de4598b4c5 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Fri Aug 31 17:57:50 2007 +0000 +++ b/pidgin/gtkconv.c Fri Aug 31 18:02:09 2007 +0000 @@ -1303,7 +1303,10 @@ menu_hide_conv_cb(gpointer data, guint action, GtkWidget *widget) { PidginWindow *win = data; + PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); + purple_signal_emit(pidgin_conversations_get_handle(), + "conversation-hiding", gtkconv); purple_conversation_set_ui_ops(conv, NULL); } @@ -7206,6 +7209,8 @@ if (gtkconv->attach.current) return TRUE; + purple_signal_emit(pidgin_conversations_get_handle(), + "conversation-displayed", gtkconv); g_source_remove(gtkconv->attach.timer); gtkconv->attach.timer = 0; return FALSE; @@ -7228,6 +7233,9 @@ list = g_list_last(list); gtkconv->attach.current = list; gtkconv->attach.timer = g_idle_add(add_message_history_to_gtkconv, gtkconv); + } else { + purple_signal_emit(pidgin_conversations_get_handle(), + "conversation-displayed", gtkconv); } /* XXX: If this is a chat: @@ -7415,6 +7423,16 @@ purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONVERSATION)); + purple_signal_register(handle, "conversation-hiding", + purple_marshal_VOID__POINTER_POINTER, NULL, 1, + purple_value_new(PURPLE_TYPE_BOXED, + "PidginConversation *")); + + purple_signal_register(handle, "conversation-displayed", + purple_marshal_VOID__POINTER_POINTER, NULL, 1, + purple_value_new(PURPLE_TYPE_BOXED, + "PidginConversation *")); + /********************************************************************** * Register commands **********************************************************************/ diff -r 858d279314b2 -r 11de4598b4c5 pidgin/gtkconv.h --- a/pidgin/gtkconv.h Fri Aug 31 17:57:50 2007 +0000 +++ b/pidgin/gtkconv.h Fri Aug 31 18:02:09 2007 +0000 @@ -245,6 +245,13 @@ */ void pidgin_conv_present_conversation(PurpleConversation *conv); +/** + * Reattach Pidgin UI to a conversation. + * + * @param conv The conversation. + * + * @return Wheter Pidgin UI was successfully attached. + */ gboolean pidgin_conv_attach_to_conversation(PurpleConversation *conv); PidginWindow *pidgin_conv_get_window(PidginConversation *gtkconv);