diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2007-12-10 17:18:40 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2007-12-10 17:18:40 +0100 |
commit | 256557f900d82149b2ada5619bd52b5e4e3fc78b (patch) | |
tree | 1025cc708de4e5c28d8efbfddc229f6d029a8578 /src/plugins/irc/irc-command.h | |
parent | 8b3980f508972313c89a7fcb5a96fed3dccff7cc (diff) | |
download | weechat-256557f900d82149b2ada5619bd52b5e4e3fc78b.zip |
Many changes in IRC plugin
Diffstat (limited to 'src/plugins/irc/irc-command.h')
-rw-r--r-- | src/plugins/irc/irc-command.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h index 66997bd9d..cec8fb8c4 100644 --- a/src/plugins/irc/irc-command.h +++ b/src/plugins/irc/irc-command.h @@ -20,18 +20,37 @@ #ifndef __WEECHAT_IRC_COMMAND_H #define __WEECHAT_IRC_COMMAND_H 1 -#define IRC_COMMAND_GET_SERVER(buffer) \ - struct t_irc_server *ptr_server = irc_server_search ( \ - weechat_buffer_get (buffer, "category")) +#include "irc-server.h" -#define IRC_COMMAND_GET_SERVER_CHANNEL(buffer) \ - struct t_irc_server *ptr_server = irc_server_search ( \ - weechat_buffer_get (buffer, "category")); \ - struct t_irc_channel *ptr_channel = irc_channel_search ( \ - ptr_server, \ - weechat_buffer_get (buffer, "name")) +#define IRC_COMMAND_GET_SERVER(__buffer) \ + struct t_weechat_plugin *buffer_plugin = NULL; \ + struct t_irc_server *ptr_server = NULL; \ + buffer_plugin = weechat_buffer_get (__buffer, "plugin"); \ + if (buffer_plugin == weechat_irc_plugin) \ + ptr_server = irc_server_search ( \ + weechat_buffer_get (__buffer, "category")); +#define IRC_COMMAND_GET_SERVER_CHANNEL(__buffer) \ + struct t_weechat_plugin *buffer_plugin = NULL; \ + struct t_irc_server *ptr_server = NULL; \ + struct t_irc_channel *ptr_channel = NULL; \ + buffer_plugin = weechat_buffer_get (__buffer, "plugin"); \ + if (buffer_plugin == weechat_irc_plugin) \ + { \ + ptr_server = irc_server_search ( \ + weechat_buffer_get (__buffer, "category")); \ + ptr_channel = irc_channel_search ( \ + ptr_server, weechat_buffer_get (__buffer, "name")); \ + } +#define IRC_COMMAND_TOO_FEW_ARGUMENTS(__buffer, __command) \ + weechat_printf (__buffer, \ + _("%sirc: too few arguments for \"%s\" command"), \ + weechat_prefix ("error"), __command); \ + return PLUGIN_RC_FAILED; + + +extern void irc_command_quit_server (struct t_irc_server *, char *); extern void irc_command_init (); #endif /* irc-command.h */ |