# HG changeset patch # User Ethan Blanton # Date 1151445347 0 # Node ID 5d5e249c488eef1bfdb7d918f94ba2460c21967b # Parent b869ab32cccc62860942a47b2ab99ad3170cd48b [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 diff -r b869ab32cccc -r 5d5e249c488e ChangeLog --- 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 diff -r b869ab32cccc -r 5d5e249c488e src/protocols/irc/cmds.c --- 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; diff -r b869ab32cccc -r 5d5e249c488e src/protocols/irc/irc.h --- 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); diff -r b869ab32cccc -r 5d5e249c488e src/protocols/irc/parse.c --- 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 <+|-><A-Za-z>: 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 <nick1> [nick2] ...: Grant channel voice status to someone. You must be a channel operator to do this.") }, { "wallops", ":", irc_cmd_wallops, N_("wallops <message>: If you don't know what this is, you probably can't use it.") }, { "whois", "tt", irc_cmd_whois, N_("whois [server] <nick>: Get information on a user.") },