1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

Join and part/quit prefixes (arrows) now displayed with different colors

This commit is contained in:
Sebastien Helleu
2005-07-22 08:11:39 +00:00
parent 29d0225e4a
commit 3d724fb634
12 changed files with 138 additions and 82 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-07-19
ChangeLog - 2005-07-22
Version 0.1.4 (under dev!):
* join and part/quit prefixes (arrows) now displayed with different colors
* added "irc_highlight" setting, to get highlight with any word
* fixed auto-rejoin for channels with key
* fixed /ctcp command (now any command/data allowed)
+10
View File
@@ -194,6 +194,8 @@ int cfg_col_chat_time;
int cfg_col_chat_time_sep;
int cfg_col_chat_prefix1;
int cfg_col_chat_prefix2;
int cfg_col_chat_join;
int cfg_col_chat_part;
int cfg_col_chat_nick;
int cfg_col_chat_host;
int cfg_col_chat_channel;
@@ -268,6 +270,14 @@ t_config_option weechat_options_colors[] =
N_("color for middle char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
{ "col_chat_join", N_("color for join arrow (prefix)"),
N_("color for join arrow (prefix)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color },
{ "col_chat_part", N_("color for part/quit arrow (prefix)"),
N_("color for part/quit arrow (prefix)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color },
{ "col_chat_nick", N_("color for nicks in actions"),
N_("color for nicks in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
+2
View File
@@ -108,6 +108,8 @@ extern int cfg_col_chat_time;
extern int cfg_col_chat_time_sep;
extern int cfg_col_chat_prefix1;
extern int cfg_col_chat_prefix2;
extern int cfg_col_chat_join;
extern int cfg_col_chat_part;
extern int cfg_col_chat_nick;
extern int cfg_col_chat_host;
extern int cfg_col_chat_channel;
+6
View File
@@ -2241,6 +2241,10 @@ gui_init_colors ()
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_JOIN,
cfg_col_chat_join, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PART,
cfg_col_chat_part, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
@@ -2329,6 +2333,8 @@ gui_init_colors ()
color_attr[COLOR_WIN_CHAT_DARK - 1] = (cfg_col_chat_dark >= 0) ? cfg_col_chat_dark & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PREFIX1 - 1] = (cfg_col_chat_prefix1 >= 0) ? cfg_col_chat_prefix1 & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PREFIX2 - 1] = (cfg_col_chat_prefix2 >= 0) ? cfg_col_chat_prefix2 & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_JOIN - 1] = (cfg_col_chat_join >= 0) ? cfg_col_chat_join & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PART - 1] = (cfg_col_chat_part >= 0) ? cfg_col_chat_part & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_NICK - 1] = (cfg_col_chat_nick >= 0) ? cfg_col_chat_nick & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_HOST - 1] = (cfg_col_chat_host >= 0) ? cfg_col_chat_host & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_CHANNEL - 1] = (cfg_col_chat_channel >= 0) ? cfg_col_chat_channel & A_BOLD : 0;
+41 -39
View File
@@ -26,52 +26,54 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 52
#define NUM_COLORS 54
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
#define COLOR_WIN_CHAT_TIME_SEP 4
#define COLOR_WIN_CHAT_PREFIX1 5
#define COLOR_WIN_CHAT_PREFIX2 6
#define COLOR_WIN_CHAT_NICK 7
#define COLOR_WIN_CHAT_HOST 8
#define COLOR_WIN_CHAT_CHANNEL 9
#define COLOR_WIN_CHAT_DARK 10
#define COLOR_WIN_CHAT_HIGHLIGHT 11
#define COLOR_WIN_STATUS 12
#define COLOR_WIN_STATUS_DELIMITERS 13
#define COLOR_WIN_STATUS_DATA_MSG 14
#define COLOR_WIN_STATUS_DATA_PRIVATE 15
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 16
#define COLOR_WIN_STATUS_DATA_OTHER 17
#define COLOR_WIN_STATUS_MORE 18
#define COLOR_WIN_INFOBAR 19
#define COLOR_WIN_INFOBAR_DELIMITERS 20
#define COLOR_WIN_INFOBAR_HIGHLIGHT 21
#define COLOR_WIN_INPUT 22
#define COLOR_WIN_INPUT_CHANNEL 23
#define COLOR_WIN_INPUT_NICK 24
#define COLOR_WIN_NICK 25
#define COLOR_WIN_NICK_AWAY 26
#define COLOR_WIN_NICK_CHANOWNER 27
#define COLOR_WIN_NICK_CHANADMIN 28
#define COLOR_WIN_NICK_OP 29
#define COLOR_WIN_NICK_HALFOP 30
#define COLOR_WIN_NICK_VOICE 31
#define COLOR_WIN_NICK_MORE 32
#define COLOR_WIN_NICK_SEP 33
#define COLOR_WIN_NICK_SELF 34
#define COLOR_WIN_NICK_PRIVATE 35
#define COLOR_WIN_NICK_FIRST 36
#define COLOR_WIN_NICK_LAST 45
#define COLOR_WIN_CHAT_JOIN 7
#define COLOR_WIN_CHAT_PART 8
#define COLOR_WIN_CHAT_NICK 9
#define COLOR_WIN_CHAT_HOST 10
#define COLOR_WIN_CHAT_CHANNEL 11
#define COLOR_WIN_CHAT_DARK 12
#define COLOR_WIN_CHAT_HIGHLIGHT 13
#define COLOR_WIN_STATUS 14
#define COLOR_WIN_STATUS_DELIMITERS 15
#define COLOR_WIN_STATUS_DATA_MSG 16
#define COLOR_WIN_STATUS_DATA_PRIVATE 17
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 18
#define COLOR_WIN_STATUS_DATA_OTHER 19
#define COLOR_WIN_STATUS_MORE 20
#define COLOR_WIN_INFOBAR 21
#define COLOR_WIN_INFOBAR_DELIMITERS 22
#define COLOR_WIN_INFOBAR_HIGHLIGHT 23
#define COLOR_WIN_INPUT 24
#define COLOR_WIN_INPUT_CHANNEL 25
#define COLOR_WIN_INPUT_NICK 26
#define COLOR_WIN_NICK 27
#define COLOR_WIN_NICK_AWAY 28
#define COLOR_WIN_NICK_CHANOWNER 29
#define COLOR_WIN_NICK_CHANADMIN 30
#define COLOR_WIN_NICK_OP 31
#define COLOR_WIN_NICK_HALFOP 32
#define COLOR_WIN_NICK_VOICE 33
#define COLOR_WIN_NICK_MORE 34
#define COLOR_WIN_NICK_SEP 35
#define COLOR_WIN_NICK_SELF 36
#define COLOR_WIN_NICK_PRIVATE 37
#define COLOR_WIN_NICK_FIRST 38
#define COLOR_WIN_NICK_LAST 47
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 46
#define COLOR_DCC_WAITING 47
#define COLOR_DCC_CONNECTING 48
#define COLOR_DCC_ACTIVE 49
#define COLOR_DCC_DONE 50
#define COLOR_DCC_FAILED 51
#define COLOR_DCC_ABORTED 52
#define COLOR_DCC_SELECTED 48
#define COLOR_DCC_WAITING 49
#define COLOR_DCC_CONNECTING 50
#define COLOR_DCC_ACTIVE 51
#define COLOR_DCC_DONE 52
#define COLOR_DCC_FAILED 53
#define COLOR_DCC_ABORTED 54
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
+8 -1
View File
@@ -57,7 +57,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
}
else
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
{
if (strcmp (prefix, PREFIX_JOIN) == 0)
gui_printf_color (buffer, COLOR_WIN_CHAT_JOIN, "%s ", prefix);
else if (strcmp (prefix, PREFIX_PART) == 0)
gui_printf_color (buffer, COLOR_WIN_CHAT_PART, "%s ", prefix);
else
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
}
}
/*
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-07-19
ChangeLog - 2005-07-22
Version 0.1.4 (under dev!):
* join and part/quit prefixes (arrows) now displayed with different colors
* added "irc_highlight" setting, to get highlight with any word
* fixed auto-rejoin for channels with key
* fixed /ctcp command (now any command/data allowed)
+10
View File
@@ -194,6 +194,8 @@ int cfg_col_chat_time;
int cfg_col_chat_time_sep;
int cfg_col_chat_prefix1;
int cfg_col_chat_prefix2;
int cfg_col_chat_join;
int cfg_col_chat_part;
int cfg_col_chat_nick;
int cfg_col_chat_host;
int cfg_col_chat_channel;
@@ -268,6 +270,14 @@ t_config_option weechat_options_colors[] =
N_("color for middle char of prefix"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
{ "col_chat_join", N_("color for join arrow (prefix)"),
N_("color for join arrow (prefix)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color },
{ "col_chat_part", N_("color for part/quit arrow (prefix)"),
N_("color for part/quit arrow (prefix)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color },
{ "col_chat_nick", N_("color for nicks in actions"),
N_("color for nicks in actions (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
+2
View File
@@ -108,6 +108,8 @@ extern int cfg_col_chat_time;
extern int cfg_col_chat_time_sep;
extern int cfg_col_chat_prefix1;
extern int cfg_col_chat_prefix2;
extern int cfg_col_chat_join;
extern int cfg_col_chat_part;
extern int cfg_col_chat_nick;
extern int cfg_col_chat_host;
extern int cfg_col_chat_channel;
+6
View File
@@ -2241,6 +2241,10 @@ gui_init_colors ()
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_JOIN,
cfg_col_chat_join, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PART,
cfg_col_chat_part, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
@@ -2329,6 +2333,8 @@ gui_init_colors ()
color_attr[COLOR_WIN_CHAT_DARK - 1] = (cfg_col_chat_dark >= 0) ? cfg_col_chat_dark & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PREFIX1 - 1] = (cfg_col_chat_prefix1 >= 0) ? cfg_col_chat_prefix1 & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PREFIX2 - 1] = (cfg_col_chat_prefix2 >= 0) ? cfg_col_chat_prefix2 & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_JOIN - 1] = (cfg_col_chat_join >= 0) ? cfg_col_chat_join & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_PART - 1] = (cfg_col_chat_part >= 0) ? cfg_col_chat_part & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_NICK - 1] = (cfg_col_chat_nick >= 0) ? cfg_col_chat_nick & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_HOST - 1] = (cfg_col_chat_host >= 0) ? cfg_col_chat_host & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT_CHANNEL - 1] = (cfg_col_chat_channel >= 0) ? cfg_col_chat_channel & A_BOLD : 0;
+41 -39
View File
@@ -26,52 +26,54 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 52
#define NUM_COLORS 54
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
#define COLOR_WIN_CHAT_TIME_SEP 4
#define COLOR_WIN_CHAT_PREFIX1 5
#define COLOR_WIN_CHAT_PREFIX2 6
#define COLOR_WIN_CHAT_NICK 7
#define COLOR_WIN_CHAT_HOST 8
#define COLOR_WIN_CHAT_CHANNEL 9
#define COLOR_WIN_CHAT_DARK 10
#define COLOR_WIN_CHAT_HIGHLIGHT 11
#define COLOR_WIN_STATUS 12
#define COLOR_WIN_STATUS_DELIMITERS 13
#define COLOR_WIN_STATUS_DATA_MSG 14
#define COLOR_WIN_STATUS_DATA_PRIVATE 15
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 16
#define COLOR_WIN_STATUS_DATA_OTHER 17
#define COLOR_WIN_STATUS_MORE 18
#define COLOR_WIN_INFOBAR 19
#define COLOR_WIN_INFOBAR_DELIMITERS 20
#define COLOR_WIN_INFOBAR_HIGHLIGHT 21
#define COLOR_WIN_INPUT 22
#define COLOR_WIN_INPUT_CHANNEL 23
#define COLOR_WIN_INPUT_NICK 24
#define COLOR_WIN_NICK 25
#define COLOR_WIN_NICK_AWAY 26
#define COLOR_WIN_NICK_CHANOWNER 27
#define COLOR_WIN_NICK_CHANADMIN 28
#define COLOR_WIN_NICK_OP 29
#define COLOR_WIN_NICK_HALFOP 30
#define COLOR_WIN_NICK_VOICE 31
#define COLOR_WIN_NICK_MORE 32
#define COLOR_WIN_NICK_SEP 33
#define COLOR_WIN_NICK_SELF 34
#define COLOR_WIN_NICK_PRIVATE 35
#define COLOR_WIN_NICK_FIRST 36
#define COLOR_WIN_NICK_LAST 45
#define COLOR_WIN_CHAT_JOIN 7
#define COLOR_WIN_CHAT_PART 8
#define COLOR_WIN_CHAT_NICK 9
#define COLOR_WIN_CHAT_HOST 10
#define COLOR_WIN_CHAT_CHANNEL 11
#define COLOR_WIN_CHAT_DARK 12
#define COLOR_WIN_CHAT_HIGHLIGHT 13
#define COLOR_WIN_STATUS 14
#define COLOR_WIN_STATUS_DELIMITERS 15
#define COLOR_WIN_STATUS_DATA_MSG 16
#define COLOR_WIN_STATUS_DATA_PRIVATE 17
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 18
#define COLOR_WIN_STATUS_DATA_OTHER 19
#define COLOR_WIN_STATUS_MORE 20
#define COLOR_WIN_INFOBAR 21
#define COLOR_WIN_INFOBAR_DELIMITERS 22
#define COLOR_WIN_INFOBAR_HIGHLIGHT 23
#define COLOR_WIN_INPUT 24
#define COLOR_WIN_INPUT_CHANNEL 25
#define COLOR_WIN_INPUT_NICK 26
#define COLOR_WIN_NICK 27
#define COLOR_WIN_NICK_AWAY 28
#define COLOR_WIN_NICK_CHANOWNER 29
#define COLOR_WIN_NICK_CHANADMIN 30
#define COLOR_WIN_NICK_OP 31
#define COLOR_WIN_NICK_HALFOP 32
#define COLOR_WIN_NICK_VOICE 33
#define COLOR_WIN_NICK_MORE 34
#define COLOR_WIN_NICK_SEP 35
#define COLOR_WIN_NICK_SELF 36
#define COLOR_WIN_NICK_PRIVATE 37
#define COLOR_WIN_NICK_FIRST 38
#define COLOR_WIN_NICK_LAST 47
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 46
#define COLOR_DCC_WAITING 47
#define COLOR_DCC_CONNECTING 48
#define COLOR_DCC_ACTIVE 49
#define COLOR_DCC_DONE 50
#define COLOR_DCC_FAILED 51
#define COLOR_DCC_ABORTED 52
#define COLOR_DCC_SELECTED 48
#define COLOR_DCC_WAITING 49
#define COLOR_DCC_CONNECTING 50
#define COLOR_DCC_ACTIVE 51
#define COLOR_DCC_DONE 52
#define COLOR_DCC_FAILED 53
#define COLOR_DCC_ABORTED 54
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
+8 -1
View File
@@ -57,7 +57,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
}
else
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
{
if (strcmp (prefix, PREFIX_JOIN) == 0)
gui_printf_color (buffer, COLOR_WIN_CHAT_JOIN, "%s ", prefix);
else if (strcmp (prefix, PREFIX_PART) == 0)
gui_printf_color (buffer, COLOR_WIN_CHAT_PART, "%s ", prefix);
else
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
}
}
/*