1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

core: use default value for prefixes used in messages displayed before the interface is initialized

This commit is contained in:
Sebastien Helleu
2013-07-27 22:31:36 +02:00
parent f385aa8f8c
commit ca1e0dde07
3 changed files with 29 additions and 11 deletions
+10 -5
View File
@@ -2272,31 +2272,36 @@ config_weechat_init_options ()
"prefix_error", "string",
N_("prefix for error messages, colors are allowed with format "
"\"${color}\""),
NULL, 0, 0, "=!=", NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT,
NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_network", "string",
N_("prefix for network messages, colors are allowed with format "
"\"${color}\""),
NULL, 0, 0, "--", NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT,
NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_action", "string",
N_("prefix for action messages, colors are allowed with format "
"\"${color}\""),
NULL, 0, 0, " *", NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT,
NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_join", "string",
N_("prefix for join messages, colors are allowed with format "
"\"${color}\""),
NULL, 0, 0, "-->", NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT,
NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_quit", "string",
N_("prefix for quit messages, colors are allowed with format "
"\"${color}\""),
NULL, 0, 0, "<--", NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT,
NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
config_look_prefix_align = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align", "integer",
+13 -6
View File
@@ -65,12 +65,19 @@ char *gui_chat_lines_waiting_buffer = NULL; /* lines waiting for core */
void
gui_chat_init ()
{
/* build empty prefixes */
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = strdup (gui_chat_prefix_empty);
gui_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = strdup (gui_chat_prefix_empty);
gui_chat_prefix[GUI_CHAT_PREFIX_ACTION] = strdup (gui_chat_prefix_empty);
gui_chat_prefix[GUI_CHAT_PREFIX_JOIN] = strdup (gui_chat_prefix_empty);
gui_chat_prefix[GUI_CHAT_PREFIX_QUIT] = strdup (gui_chat_prefix_empty);
char *default_prefix[GUI_CHAT_NUM_PREFIXES] =
{ GUI_CHAT_PREFIX_ERROR_DEFAULT, GUI_CHAT_PREFIX_NETWORK_DEFAULT,
GUI_CHAT_PREFIX_ACTION_DEFAULT, GUI_CHAT_PREFIX_JOIN_DEFAULT,
GUI_CHAT_PREFIX_QUIT_DEFAULT };
char str_prefix[64];
int i;
/* build default prefixes */
for (i = 0; i < GUI_CHAT_NUM_PREFIXES; i++)
{
snprintf (str_prefix, sizeof (str_prefix), "%s\t", default_prefix[i]);
gui_chat_prefix[i] = strdup (str_prefix);
}
/* some hsignals */
hook_hsignal (NULL, "chat_quote_time_prefix_message",
+6
View File
@@ -30,6 +30,12 @@ struct t_gui_line;
#define GUI_CHAT_TAG_NO_HIGHLIGHT "no_highlight"
#define GUI_CHAT_PREFIX_ERROR_DEFAULT "=!="
#define GUI_CHAT_PREFIX_NETWORK_DEFAULT "--"
#define GUI_CHAT_PREFIX_ACTION_DEFAULT " *"
#define GUI_CHAT_PREFIX_JOIN_DEFAULT "-->"
#define GUI_CHAT_PREFIX_QUIT_DEFAULT "<--"
enum t_gui_chat_prefix
{
GUI_CHAT_PREFIX_ERROR = 0,