diff src/protocols/irc/irc.c @ 3501:3335ef5fbecc

[gaim-migrate @ 3564] i18n fixes from paco-paco and msw, /topic fix from kingant. get the i18n fixes into gtk1-stable and i'm done for the night. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 14 Sep 2002 03:17:05 +0000
parents 7a3f16a375a5
children 7e1c6c16dd41
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Sat Sep 14 03:08:39 2002 +0000
+++ b/src/protocols/irc/irc.c	Sat Sep 14 03:17:05 2002 +0000
@@ -1592,11 +1592,14 @@
 		irc_write(id->fd, buf, strlen(buf));
 	} else if (!g_strcasecmp(pdibuf, "TOPIC")) {
 		if (!*word_eol[2]) {
-			g_free(what);
-			return -EINVAL;
+			struct conversation *c;
+			c = irc_find_chat(gc, who);
+			g_snprintf(buf, sizeof(buf), _("Topic for %s is %s"), who, c->topic ? c->topic : "(no topic set)");
+			write_to_conv(c, buf, WFLAG_SYSTEM | WFLAG_NOLOG, NULL, time(NULL), -1);
+		} else {
+			g_snprintf(buf, sizeof(buf), "TOPIC %s :%s\r\n", who, word_eol[2]);
+			irc_write(id->fd, buf, strlen(buf));
 		}
-		g_snprintf(buf, sizeof(buf), "TOPIC %s :%s\r\n", who, word_eol[2]);
-		irc_write(id->fd, buf, strlen(buf));
 	} else if (!g_strcasecmp(pdibuf, "NICK")) {
 		if (!*word_eol[2]) {
 			g_free(what);