diff options
Diffstat (limited to 'src/plugins/irc/irc-config.c')
-rw-r--r-- | src/plugins/irc/irc-config.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 5362ca468..57304bf38 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -34,6 +34,7 @@ #include "irc-channel.h" #include "irc-ctcp.h" #include "irc-ignore.h" +#include "irc-mode.h" #include "irc-msgbuffer.h" #include "irc-nick.h" #include "irc-notify.h" @@ -1000,6 +1001,9 @@ irc_config_server_default_change_cb (const void *pointer, void *data, else irc_server_remove_away (ptr_server); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + irc_mode_registered_mode_change (ptr_server); + break; } } } @@ -1218,6 +1222,20 @@ irc_config_server_check_value_cb (const void *pointer, void *data, return 0; } break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + if (!value || !value[0]) + break; + /* Only one character should be accepted */ + if (value[1]) + { + weechat_printf ( + NULL, + _("%s%s: invalid registered mode, must be a single " + "character"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); + return 0; + } + break; } } @@ -1270,6 +1288,9 @@ irc_config_server_change_cb (const void *pointer, void *data, case IRC_SERVER_OPTION_NOTIFY: irc_notify_new_for_server (ptr_server); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + irc_mode_registered_mode_change (ptr_server); + break; } } } @@ -2502,6 +2523,22 @@ irc_config_server_new_option (struct t_config_file *config_file, callback_change_data, NULL, NULL, NULL); break; + case IRC_SERVER_OPTION_REGISTERED_MODE: + new_option = weechat_config_new_option ( + config_file, section, + option_name, "string", + N_("mode that is set on registered users (default is \"r\")"), + NULL, 0, 0, + default_value, value, + null_value_allowed, + callback_check_value, + callback_check_value_pointer, + callback_check_value_data, + callback_change, + callback_change_pointer, + callback_change_data, + NULL, NULL, NULL); + break; case IRC_SERVER_NUM_OPTIONS: break; } |