changeset 19556:11de4598b4c5

Document the function to reattach conv-ui. Introduce the conversation-hiding and conversation-displayed signals in pidgin.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 31 Aug 2007 18:02:09 +0000
parents 858d279314b2
children 7971aadbf56c
files pidgin/gtkconv.c pidgin/gtkconv.h
diffstat 2 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
 	 **********************************************************************/
--- 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);