changeset 13881:5d5e249c488e

[gaim-migrate @ 16361] ------------------------------------------------------------------------ r16360 | eblanton | 2006-06-27 17:54:44 -0400 (Tue, 27 Jun 2006) | 1 line IRC support for CTCP VERSION from Andrej Krivulk ------------------------------------------------------------------------ committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 27 Jun 2006 21:55:47 +0000
parents b869ab32cccc
children 5c750626eaa5
files ChangeLog src/protocols/irc/cmds.c src/protocols/irc/irc.h src/protocols/irc/parse.c
diffstat 4 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 27 16:28:20 2006 +0000
+++ b/ChangeLog	Tue Jun 27 21:55:47 2006 +0000
@@ -130,6 +130,7 @@
 	  channel or change your nick
 	* Added /nickserv, /memoserv, /chanserv and /operserv
 	  commands (Joao Luís Marques Pinto)
+	* Added CTCP VERSION via /version (Andrej Krivulčík)
 
 	Jabber Features:
 	* Support for SRV lookups
--- a/src/protocols/irc/cmds.c	Tue Jun 27 16:28:20 2006 +0000
+++ b/src/protocols/irc/cmds.c	Tue Jun 27 21:55:47 2006 +0000
@@ -127,6 +127,21 @@
 	return 1;
 }
 
+int irc_cmd_ctcp_version(struct irc_conn *irc, const char *cmd, const char *target, const char **args)
+{
+	char *buf;
+
+
+	if (!args || !args[0])
+		return 0;
+
+	buf = irc_format(irc, "vn:", "PRIVMSG", args[0], "\001VERSION\001");
+	irc_send(irc, buf);
+	g_free(buf);
+
+	return 0;
+}
+
 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args)
 {
 	char *buf;
--- a/src/protocols/irc/irc.h	Tue Jun 27 16:28:20 2006 +0000
+++ b/src/protocols/irc/irc.h	Tue Jun 27 21:55:47 2006 +0000
@@ -152,6 +152,7 @@
 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_ctcp_action(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
+int irc_cmd_ctcp_version(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
 int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args);
--- a/src/protocols/irc/parse.c	Tue Jun 27 16:28:20 2006 +0000
+++ b/src/protocols/irc/parse.c	Tue Jun 27 21:55:47 2006 +0000
@@ -140,6 +140,7 @@
 	{ "time", "", irc_cmd_time, N_("time: Displays the current local time at the IRC server.") },
 	{ "topic", ":", irc_cmd_topic, N_("topic [new topic]:  View or change the channel topic.") },
 	{ "umode", ":", irc_cmd_mode, N_("umode &lt;+|-&gt;&lt;A-Za-z&gt;:  Set or unset a user mode.") },
+	{ "version", ":", irc_cmd_ctcp_version, N_("version [nick]: send CTCP VERSION request to a user") },
 	{ "voice", ":", irc_cmd_op, N_("voice &lt;nick1&gt; [nick2] ...:  Grant channel voice status to someone. You must be a channel operator to do this.") },
 	{ "wallops", ":", irc_cmd_wallops, N_("wallops &lt;message&gt;:  If you don't know what this is, you probably can't use it.") },
 	{ "whois", "tt", irc_cmd_whois, N_("whois [server] &lt;nick&gt;:  Get information on a user.") },