changeset 9154:dcb290a0c970

[gaim-migrate @ 9938] Thanks to Stu Tomlinson, we can now change the IRC topic by way of the input box at the top of each chat. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Mon, 31 May 2004 21:55:21 +0000
parents 5ad89e84b3d3
children e0c50af60837
files src/protocols/irc/irc.c
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Mon May 31 07:31:20 2004 +0000
+++ b/src/protocols/irc/irc.c	Mon May 31 21:55:21 2004 +0000
@@ -500,6 +500,23 @@
 	g_free(ib);
 }
 
+static void irc_chat_set_topic(GaimConnection *gc, int id, const char *topic)
+{
+	char *buf;
+	const char *name = NULL;
+	struct irc_conn *irc;
+
+	irc = gc->proto_data;
+	name = gaim_conversation_get_name(gaim_find_chat(gc, id));
+
+	if (name == NULL)
+		return;
+
+	buf = irc_format(irc, "vt:", "TOPIC", name, topic);
+	irc_send(irc, buf);
+	g_free(buf);
+}
+
 static GaimRoomlist *irc_roomlist_get_list(GaimConnection *gc)
 {
 	struct irc_conn *irc;
@@ -601,7 +618,7 @@
 	NULL, /* set buddy icon */
 	NULL, /* remove group */
 	NULL, /* get_cb_real_name */
-	NULL,
+	irc_chat_set_topic,
 	NULL,
 	irc_roomlist_get_list,
 	irc_roomlist_cancel,