changeset 21967:33f4a9e685a3

Added /notice support for IRC. If I didn't do this properly, feel free to disapprove this revision, elb.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 30 Dec 2007 18:46:56 +0000
parents 1796af35d1aa
children a463f05b4566
files libpurple/protocols/irc/cmds.c libpurple/protocols/irc/parse.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/irc/cmds.c	Sun Dec 30 13:56:01 2007 +0000
+++ b/libpurple/protocols/irc/cmds.c	Sun Dec 30 18:46:56 2007 +0000
@@ -367,7 +367,12 @@
 		if (!end)
 			end = cur + strlen(cur);
 		msg = g_strndup(cur, end - cur);
-		buf = irc_format(irc, "vt:", "PRIVMSG", args[0], msg);
+
+		if(!strcmp(cmd, "msg"))
+			buf = irc_format(irc, "vt:", "PRIVMSG", args[0], msg);
+		else /* seding a notice if we get here */
+			buf = irc_format(irc, "vt:", "NOTICE", args[0], msg);
+
 		irc_send(irc, buf);
 		g_free(msg);
 		g_free(buf);
--- a/libpurple/protocols/irc/parse.c	Sun Dec 30 13:56:01 2007 +0000
+++ b/libpurple/protocols/irc/parse.c	Sun Dec 30 18:46:56 2007 +0000
@@ -136,6 +136,7 @@
 	{ "names", "c", irc_cmd_names, N_("names [channel]:  List the users currently in a channel.") },
 	{ "nick", "n", irc_cmd_nick, N_("nick &lt;new nickname&gt;:  Change your nickname.") },
 	{ "nickserv", ":", irc_cmd_service, N_("nickserv: Send a command to nickserv") },
+	{ "notice", "t:", irc_cmd_privmsg, N_("notice &lt;target&lt;:  Send a notice to a user or channel.") },
 	{ "op", ":", irc_cmd_op, N_("op &lt;nick1&gt; [nick2] ...:  Grant channel operator status to someone. You must be a channel operator to do this.") },
 	{ "operwall", ":", irc_cmd_wallops, N_("operwall &lt;message&gt;:  If you don't know what this is, you probably can't use it.") },
 	{ "operserv", ":", irc_cmd_service, N_("operserv: Send a command to operserv") },