diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2003-09-27 12:11:41 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2003-09-27 12:11:41 +0000 |
commit | a7091f895d22b224896742b2ca3f6c064bf6637a (patch) | |
tree | 248084b384b4dd885444b9408407e24ce8391d6e /src | |
parent | 109101faebaa56cc93916803898608328016bf46 (diff) | |
download | weechat-a7091f895d22b224896742b2ca3f6c064bf6637a.zip |
Command CTCP VERSION completed.
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/irc-commands.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c index 2b4cf33ec..a830d938c 100644 --- a/src/irc/irc-commands.c +++ b/src/irc/irc-commands.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <string.h> #include <time.h> +#include <sys/utsname.h> #include "../weechat.h" #include "irc.h" @@ -1665,6 +1666,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) char *pos, *pos2, *host2; t_irc_channel *ptr_channel; t_irc_nick *ptr_nick; + struct utsname *buf; /* no host => we can't identify sender of message! */ if (host == NULL) @@ -1759,11 +1761,27 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) pos++; if (strcmp (pos, "\01VERSION\01") == 0) + { + buf = (struct utsname *) malloc (sizeof (struct utsname)); + uname (buf); server_sendf (server, "NOTICE %s :\01VERSION " WEECHAT_NAME " v" - WEECHAT_VERSION ", compiled on " __DATE__ "\01\r\n", - host); + WEECHAT_VERSION " compiled on " __DATE__ + ", \"%s\" running %s %s on a %s\01\r\n", + host, &buf->nodename, &buf->sysname, + &buf->release, &buf->machine); + free (buf); + irc_display_prefix (server->window, PREFIX_INFO); + gui_printf_color (server->window, + COLOR_WIN_CHAT, _("Received a ")); + gui_printf_color (server->window, + COLOR_WIN_CHAT_CHANNEL, _("CTCP VERSION ")); + gui_printf_color (server->window, + COLOR_WIN_CHAT, _("from")); + gui_printf_color (server->window, + COLOR_WIN_CHAT_NICK, " %s\n", host); + } else { /* private message received */ |