changeset 9517:0524b36c701a

[gaim-migrate @ 10344] " And hopefully i got everything updated this time around.. everything being signals_test.c, plugins/ChangeLog.API and doc/conversation-signals.dox." --Gary Kramlich committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 12 Jul 2004 19:37:07 +0000
parents 464e2b6bc7e6
children 6c24a6f07256
files doc/conversation-signals.dox plugins/ChangeLog.API plugins/signals-test.c src/conversation.c
diffstat 4 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/conversation-signals.dox	Mon Jul 12 18:00:26 2004 +0000
+++ b/doc/conversation-signals.dox	Mon Jul 12 19:37:07 2004 +0000
@@ -32,6 +32,7 @@
   @signal chat-invited
   @signal chat-joined
   @signal chat-left
+  @signal chat-topic-changed
  @endsignals
 
  @signaldef writing-im-msg
@@ -437,5 +438,16 @@
   @param conv The conversation that left the chat room.
  @endsignaldef
 
+ @signaldef chat-topic-changed
+  @signalproto
+void (*chat_topic_changed)(GaimConversation *conv, const char *who, const char *topic);
+  @endsignalproto
+  @signaldesc
+   Emitted when the topic is changed in a chat.
+  @param conv  The conversation whose topic changed.
+  @param who   The name of the person that changed the topic.
+  @param topic The new topic.
+ @endsignaldef
+
 */
 // vim: syntax=c tw=75 et
--- a/plugins/ChangeLog.API	Mon Jul 12 18:00:26 2004 +0000
+++ b/plugins/ChangeLog.API	Mon Jul 12 19:37:07 2004 +0000
@@ -12,6 +12,7 @@
 	Signals:
 	* Changed "chat-invited" to also include the components hash table so 
 	  plugins can use serv_join_chat when the signal is emitted.
+	* Added "chat-topic-changed" signal plugins know when a topic is changed.
 
 version 0.79 (06/24/2004):
 	Gaim API:
--- a/plugins/signals-test.c	Mon Jul 12 18:00:26 2004 +0000
+++ b/plugins/signals-test.c	Mon Jul 12 19:37:07 2004 +0000
@@ -414,6 +414,15 @@
 					gaim_conversation_get_name(conv));
 }
 
+static void
+chat_topic_changed_cb(GaimConversation *conv, const char *who,
+					  const char *topic, void *data)
+{
+	gaim_debug_misc("signals test",
+					"chat-topic-changed (%s topic changed to: \"%s\" by %s)\n",
+					gaim_conversation_get_name(conv), topic,
+					(who) ? who : "unknown");
+}
 /**************************************************************************
  * Core signal callbacks
  **************************************************************************/
@@ -534,6 +543,8 @@
 						plugin, GAIM_CALLBACK(chat_joined_cb), NULL);
 	gaim_signal_connect(conv_handle, "chat-left",
 						plugin, GAIM_CALLBACK(chat_left_cb), NULL);
+	gaim_signal_connect(conv_handle, "chat-topic-changed",
+						plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL);
 
 	/* Core signals */
 	gaim_signal_connect(core_handle, "quitting",
--- a/src/conversation.c	Mon Jul 12 18:00:26 2004 +0000
+++ b/src/conversation.c	Mon Jul 12 19:37:07 2004 +0000
@@ -1842,6 +1842,9 @@
 
 	gaim_conversation_update(gaim_conv_chat_get_conversation(chat),
 							 GAIM_CONV_UPDATE_TOPIC);
+
+	gaim_signal_emit(gaim_conversations_get_handle(), "chat-topic-changed",
+					 chat->conv, chat->who, chat->topic);
 }
 
 const char *
@@ -2853,6 +2856,13 @@
 						 gaim_marshal_VOID__POINTER, NULL, 1,
 						 gaim_value_new(GAIM_TYPE_SUBTYPE,
 										GAIM_SUBTYPE_CONVERSATION));
+
+	gaim_signal_register(handle, "chat-topic-changed",
+						 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 2,
+						 gaim_value_new(GAIM_TYPE_SUBTYPE,
+										GAIM_SUBTYPE_CONVERSATION),
+						 gaim_value_new(GAIM_TYPE_STRING),
+						 gaim_value_new(GAIM_TYPE_STRING));
 }
 
 void