From 69b53c8f3db9e52f4bbc0bb2ce02c19568e9e695 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 2 Feb 2010 15:39:04 +0100 Subject: Add IRC command /map --- src/plugins/irc/irc-command.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/plugins/irc') diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 74e9df915..10e81d173 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -1976,6 +1976,29 @@ irc_command_lusers (void *data, struct t_gui_buffer *buffer, int argc, return WEECHAT_RC_OK; } +/* + * irc_command_map: show a graphical map of the IRC network + */ + +int +irc_command_map (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + IRC_GET_SERVER(buffer); + IRC_COMMAND_CHECK_SERVER("map", 1); + + /* make C compiler happy */ + (void) data; + (void) argv; + + if (argc > 1) + irc_server_sendf (ptr_server, 0, "MAP %s", argv_eol[1]); + else + irc_server_sendf (ptr_server, 0, "MAP"); + + return WEECHAT_RC_OK; +} + /* * irc_command_me: send a ctcp action to the current channel */ @@ -4166,6 +4189,11 @@ irc_command_init () N_(" mask: servers matching the mask only\n" "target: server for forwarding request"), NULL, &irc_command_lusers, NULL); + weechat_hook_command ("map", + N_("show a graphical map of the IRC network"), + "", + "", + NULL, &irc_command_map, NULL); weechat_hook_command ("me", N_("send a CTCP action to the current channel"), N_("message"), -- cgit v1.2.3