1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 17:23:15 +02:00

Fixed /away command, new [irc] config section, option "look_display_away" moved to "irc_display_away", added default away/part/quit messages in config file

This commit is contained in:
Sebastien Helleu
2005-01-04 22:48:40 +00:00
parent 96fc2c9aec
commit 2f5c9a8fd4
12 changed files with 996 additions and 798 deletions
+34 -9
View File
@@ -49,6 +49,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
{ CONFIG_SECTION_COLORS, "colors" },
{ CONFIG_SECTION_HISTORY, "history" },
{ CONFIG_SECTION_LOG, "log" },
{ CONFIG_SECTION_IRC, "irc" },
{ CONFIG_SECTION_DCC, "dcc" },
{ CONFIG_SECTION_PROXY, "proxy" },
{ CONFIG_SECTION_ALIAS, "alias" },
@@ -76,7 +77,6 @@ int cfg_look_nickmode;
int cfg_look_nickmode_empty;
char *cfg_look_no_nickname;
char *cfg_look_completor;
int cfg_look_display_away;
int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_delay_highlight;
@@ -152,10 +152,6 @@ t_config_option weechat_options_look[] =
N_("the string inserted after nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
":", NULL, NULL, &cfg_look_completor, config_change_noop },
{ "look_display_away", N_("display message to all channels when away"),
N_("display message to all channels when (un)marking as away"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_display_away, NULL, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -458,6 +454,33 @@ t_config_option weechat_options_log[] =
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
/* config, irc section */
int cfg_irc_display_away;
char *cfg_irc_default_msg_away;
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
t_config_option weechat_options_irc[] =
{ { "irc_display_away", N_("display message to all channels when away"),
N_("display message to all channels when (un)marking as away"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_display_away, NULL, config_change_noop },
{ "irc_default_msg_away", N_("default message when away"),
N_("default message when away"),
OPTION_TYPE_STRING, 0, 0, 0,
"away", NULL, NULL, &cfg_irc_default_msg_away, config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_quit, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
/* config, dcc section */
int cfg_dcc_auto_accept_files;
@@ -608,8 +631,8 @@ t_config_option weechat_options_server[] =
t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
{ weechat_options_look, weechat_options_colors, weechat_options_history,
weechat_options_log, weechat_options_dcc, weechat_options_proxy,
NULL, weechat_options_server
weechat_options_log, weechat_options_irc, weechat_options_dcc,
weechat_options_proxy, NULL, weechat_options_server
};
@@ -1159,8 +1182,7 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if ((i == CONFIG_SECTION_HISTORY) || (i == CONFIG_SECTION_LOG) ||
(i == CONFIG_SECTION_DCC) || (i == CONFIG_SECTION_PROXY))
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
@@ -1225,6 +1247,8 @@ config_create_default ()
fprintf (file, "\n[server]\n");
fprintf (file, "server_name=freenode\n");
fprintf (file, "server_autoconnect=on\n");
fprintf (file, "server_autoreconnect=on\n");
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_password=\n");
@@ -1269,6 +1293,7 @@ config_create_default ()
}
fprintf (file, "server_command=\n");
fprintf (file, "server_command_delay=0\n");
fprintf (file, "server_autojoin=\n");
fprintf (file, "server_autorejoin=on\n");
+11 -6
View File
@@ -28,11 +28,12 @@
#define CONFIG_SECTION_COLORS 1
#define CONFIG_SECTION_HISTORY 2
#define CONFIG_SECTION_LOG 3
#define CONFIG_SECTION_DCC 4
#define CONFIG_SECTION_PROXY 5
#define CONFIG_SECTION_ALIAS 6
#define CONFIG_SECTION_SERVER 7
#define CONFIG_NUMBER_SECTIONS 8
#define CONFIG_SECTION_IRC 4
#define CONFIG_SECTION_DCC 5
#define CONFIG_SECTION_PROXY 6
#define CONFIG_SECTION_ALIAS 7
#define CONFIG_SECTION_SERVER 8
#define CONFIG_NUMBER_SECTIONS 9
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
@@ -90,7 +91,6 @@ extern int cfg_look_nickmode;
extern int cfg_look_nickmode_empty;
extern char *cfg_look_no_nickname;
extern char *cfg_look_completor;
extern int cfg_look_display_away;
extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_delay_highlight;
@@ -148,6 +148,11 @@ extern char *cfg_log_path;
extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_irc_display_away;
extern char *cfg_irc_default_msg_away;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;