summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-command.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-07-06 21:16:56 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-07-08 13:29:45 +0200
commit481e8f197d1e713ed94d1603c0af272fb202a65b (patch)
tree4b349348e4aa86a85b21202d1550c7f0d059bc1e /src/plugins/irc/irc-command.c
parent66cb9f6ea2e534887e73c885d3f131710c48382d (diff)
downloadweechat-481e8f197d1e713ed94d1603c0af272fb202a65b.zip
core: use type "enum" in options
Diffstat (limited to 'src/plugins/irc/irc-command.c')
-rw-r--r--src/plugins/irc/irc-command.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 56c49ee10..a0faacc5e 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1008,7 +1008,7 @@ IRC_COMMAND_CALLBACK(auth)
if (weechat_hashtable_has_key (ptr_server->cap_list, "sasl"))
{
/* SASL capability already enabled, authenticate */
- sasl_mechanism = IRC_SERVER_OPTION_INTEGER(
+ sasl_mechanism = IRC_SERVER_OPTION_ENUM(
ptr_server, IRC_SERVER_OPTION_SASL_MECHANISM);
if ((sasl_mechanism >= 0)
&& (sasl_mechanism < IRC_NUM_SASL_MECHANISMS))
@@ -1278,11 +1278,11 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments,
server->away_time = time (NULL);
irc_server_sendf (server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
"AWAY :%s", arguments);
- if (weechat_config_integer (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF)
+ if (weechat_config_enum (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF)
{
string = irc_color_decode (arguments,
weechat_config_boolean (irc_config_network_colors_send));
- if (weechat_config_integer (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL)
+ if (weechat_config_enum (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL)
{
irc_command_display_away (server, "away",
(string) ? string : arguments);
@@ -1350,9 +1350,9 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments,
elapsed = (time_now >= server->away_time) ?
time_now - server->away_time : 0;
server->away_time = 0;
- if (weechat_config_integer (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF)
+ if (weechat_config_enum (irc_config_look_display_away) != IRC_CONFIG_DISPLAY_AWAY_OFF)
{
- if (weechat_config_integer (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL)
+ if (weechat_config_enum (irc_config_look_display_away) == IRC_CONFIG_DISPLAY_AWAY_LOCAL)
{
snprintf (buffer, sizeof (buffer),
"gone %.2ld:%.2ld:%.2ld",
@@ -5124,11 +5124,11 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
/* sasl_mechanism */
if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_SASL_MECHANISM]))
weechat_printf (NULL, " sasl_mechanism . . . : ('%s')",
- irc_sasl_mechanism_string[IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_MECHANISM)]);
+ irc_sasl_mechanism_string[IRC_SERVER_OPTION_ENUM(server, IRC_SERVER_OPTION_SASL_MECHANISM)]);
else
weechat_printf (NULL, " sasl_mechanism . . . : %s'%s'",
IRC_COLOR_CHAT_VALUE,
- irc_sasl_mechanism_string[weechat_config_integer (server->options[IRC_SERVER_OPTION_SASL_MECHANISM])]);
+ irc_sasl_mechanism_string[weechat_config_enum (server->options[IRC_SERVER_OPTION_SASL_MECHANISM])]);
/* sasl_username */
if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_SASL_USERNAME]))
weechat_printf (NULL, " sasl_username. . . . : ('%s')",
@@ -5166,11 +5166,11 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
/* sasl_fail */
if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_SASL_FAIL]))
weechat_printf (NULL, " sasl_fail. . . . . . : ('%s')",
- irc_server_sasl_fail_string[IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_FAIL)]);
+ irc_server_sasl_fail_string[IRC_SERVER_OPTION_ENUM(server, IRC_SERVER_OPTION_SASL_FAIL)]);
else
weechat_printf (NULL, " sasl_fail. . . . . . : %s'%s'",
IRC_COLOR_CHAT_VALUE,
- irc_server_sasl_fail_string[weechat_config_integer (server->options[IRC_SERVER_OPTION_SASL_FAIL])]);
+ irc_server_sasl_fail_string[weechat_config_enum (server->options[IRC_SERVER_OPTION_SASL_FAIL])]);
/* autoconnect */
if (weechat_config_option_is_null (server->options[IRC_SERVER_OPTION_AUTOCONNECT]))
weechat_printf (NULL, " autoconnect. . . . . : (%s)",