changeset 2293:88552158f19b

[gaim-migrate @ 2303] test. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 17 Sep 2001 06:28:08 +0000
parents 6625d0755c51
children b6c6603a8915
files src/protocols/irc/irc.c
diffstat 1 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Mon Sep 17 06:21:33 2001 +0000
+++ b/src/protocols/irc/irc.c	Mon Sep 17 06:28:08 2001 +0000
@@ -789,10 +789,31 @@
 		if (msg[0] == 1 && msg[strlen (msg) - 1] == 1) { /* ctcp */
 			if (!g_strncasecmp(msg + 1, "ACTION", 6)) {
 				char *po = strchr(msg + 7, 1);
+				char *tmp;
 				if (po) *po = 0;
-				to = g_strconcat("/me", msg + 7, NULL);
-				irc_got_im(gc, nick, to, 0, time(NULL));
-				g_free(to);
+				if (is_channel(gc, to)) {
+					struct conversation *c = irc_find_chat(gc, to);
+					if (!c)
+						return;
+					tmp = g_strconcat("/me", msg + 7, NULL);
+					irc_got_chat_in(gc, c->id, nick, 0, tmp, time(NULL));
+					g_free(tmp);
+				} else {
+					tmp = g_strconcat("/me", msg + 7, NULL);
+					to = g_malloc(strlen(nick) + 2);
+					g_snprintf(to, strlen(nick) + 2, "@%s", nick);
+					if (find_conversation(to))
+						irc_got_im(gc, to, tmp, 0, time(NULL));
+					else {
+						*to = '+';
+						if (find_conversation(to))
+							irc_got_im(gc, to, tmp, 0, time(NULL));
+						else
+							irc_got_im(gc, nick, tmp, 0, time(NULL));
+					}
+					g_free(to);
+					g_free(tmp);
+				}
 			}
 		} else {
 			if (is_channel(gc, to)) {