1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

Added color for private in hotlist (different than color for highlight)

This commit is contained in:
Sebastien Helleu
2005-07-13 17:40:20 +00:00
parent 06bd0f9f0e
commit 1d07964d17
22 changed files with 1966 additions and 1750 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2005-07-13
Versoin 0.1.4 (under dev!):
Version 0.1.4 (under dev!):
* added color for private in hotlist (different than color for highlight)
* added DCC resume and timeout
* added function for Perl/Python to get DCC list
* fixed FIFO pipe (command now authorized on a buffer not connected
+293 -266
View File
File diff suppressed because it is too large Load Diff
+295 -266
View File
File diff suppressed because it is too large Load Diff
+296 -269
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -23,12 +23,17 @@
#include "../irc/irc.h"
#define HOTLIST_LOW 0
#define HOTLIST_MSG 1
#define HOTLIST_PRIVATE 2
#define HOTLIST_HIGHLIGHT 3
typedef struct t_weechat_hotlist t_weechat_hotlist;
struct t_weechat_hotlist
{
int priority; /* 0=crappy msg (join/part), 1=msg, */
/* 2=nick highlight */
/* 2=pv, 3=nick highlight */
t_gui_buffer *buffer; /* associated buffer */
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
+6 -1
View File
@@ -203,6 +203,7 @@ int cfg_col_chat_bg;
int cfg_col_status;
int cfg_col_status_delimiters;
int cfg_col_status_data_msg;
int cfg_col_status_data_private;
int cfg_col_status_data_highlight;
int cfg_col_status_data_other;
int cfg_col_status_more;
@@ -305,10 +306,14 @@ t_config_option weechat_options_colors[] =
N_("color for window with new messages (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
{ "col_status_private", N_("color for window with private message"),
N_("color for window with private message (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_private, NULL, &config_change_color },
{ "col_status_highlight", N_("color for window with highlight"),
N_("color for window with highlight (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
"lightred", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
{ "col_status_data_other", N_("color for window with new data (not messages)"),
N_("color for window with new data (not messages) (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
+1
View File
@@ -117,6 +117,7 @@ extern int cfg_col_chat_bg;
extern int cfg_col_status;
extern int cfg_col_status_delimiters;
extern int cfg_col_status_data_msg;
extern int cfg_col_status_data_private;
extern int cfg_col_status_data_highlight;
extern int cfg_col_status_data_other;
extern int cfg_col_status_more;
+18 -6
View File
@@ -1254,15 +1254,19 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
{
switch (ptr_hotlist->priority)
{
case 0:
case HOTLIST_LOW:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_OTHER);
break;
case 1:
case HOTLIST_MSG:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_MSG);
break;
case 2:
case HOTLIST_PRIVATE:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_PRIVATE);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
break;
@@ -2278,6 +2282,8 @@ gui_init_colors ()
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_PRIVATE,
cfg_col_status_data_private, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
@@ -2356,6 +2362,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_STATUS - 1] = (cfg_col_status >= 0) ? cfg_col_status & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DELIMITERS - 1] = (cfg_col_status_delimiters >= 0) ? cfg_col_status_delimiters & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_MSG - 1] = (cfg_col_status_data_msg >= 0) ? cfg_col_status_data_msg & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_PRIVATE - 1] = (cfg_col_status_data_private >= 0) ? cfg_col_status_data_private & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_HIGHLIGHT - 1] = (cfg_col_status_data_highlight >= 0) ? cfg_col_status_data_highlight & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_OTHER - 1] = (cfg_col_status_data_other >= 0) ? cfg_col_status_data_other & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_MORE - 1] = (cfg_col_status_more >= 0) ? cfg_col_status_more & A_BOLD : 0;
@@ -2547,9 +2554,14 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
buffer->last_line->line_with_highlight <=
buffer->notify_level)
{
hotlist_add (buffer->last_line->line_with_message +
buffer->last_line->line_with_highlight,
buffer);
if (buffer->last_line->line_with_highlight)
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
else if (BUFFER_IS_PRIVATE(buffer))
hotlist_add (HOTLIST_PRIVATE, buffer);
else if (buffer->last_line->line_with_message)
hotlist_add (HOTLIST_MSG, buffer);
else
hotlist_add (HOTLIST_LOW, buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+31 -30
View File
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 51
#define NUM_COLORS 52
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -41,36 +41,37 @@
#define COLOR_WIN_STATUS 12
#define COLOR_WIN_STATUS_DELIMITERS 13
#define COLOR_WIN_STATUS_DATA_MSG 14
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 15
#define COLOR_WIN_STATUS_DATA_OTHER 16
#define COLOR_WIN_STATUS_MORE 17
#define COLOR_WIN_INFOBAR 18
#define COLOR_WIN_INFOBAR_DELIMITERS 19
#define COLOR_WIN_INFOBAR_HIGHLIGHT 20
#define COLOR_WIN_INPUT 21
#define COLOR_WIN_INPUT_CHANNEL 22
#define COLOR_WIN_INPUT_NICK 23
#define COLOR_WIN_NICK 24
#define COLOR_WIN_NICK_AWAY 25
#define COLOR_WIN_NICK_CHANOWNER 26
#define COLOR_WIN_NICK_CHANADMIN 27
#define COLOR_WIN_NICK_OP 28
#define COLOR_WIN_NICK_HALFOP 29
#define COLOR_WIN_NICK_VOICE 30
#define COLOR_WIN_NICK_MORE 31
#define COLOR_WIN_NICK_SEP 32
#define COLOR_WIN_NICK_SELF 33
#define COLOR_WIN_NICK_PRIVATE 34
#define COLOR_WIN_NICK_FIRST 35
#define COLOR_WIN_NICK_LAST 44
#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_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 45
#define COLOR_DCC_WAITING 46
#define COLOR_DCC_CONNECTING 47
#define COLOR_DCC_ACTIVE 48
#define COLOR_DCC_DONE 49
#define COLOR_DCC_FAILED 50
#define COLOR_DCC_ABORTED 51
#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 SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
+33 -33
View File
@@ -159,7 +159,7 @@ dcc_find_filename (t_irc_dcc *ptr_dcc)
if (!cfg_dcc_auto_rename)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
@@ -167,7 +167,7 @@ dcc_find_filename (t_irc_dcc *ptr_dcc)
if (!filename2)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
ptr_dcc->filename_suffix = 0;
@@ -405,7 +405,7 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
"(maybe private buffer has already DCC CHAT?)\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
@@ -433,7 +433,7 @@ dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
if (!dcc_connect (ptr_dcc))
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
{
@@ -458,7 +458,7 @@ dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
dcc_channel_for_chat (ptr_dcc);
}
}
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
/*
@@ -477,7 +477,7 @@ dcc_accept (t_irc_dcc *ptr_dcc)
"PRIVMSG %s :\01DCC RESUME %s %d %u\01\r\n",
ptr_dcc->nick, ptr_dcc->filename,
ptr_dcc->port, ptr_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_recv_connect_init (ptr_dcc);
@@ -515,7 +515,7 @@ dcc_accept_resume (t_irc_server *server, char *filename, int port,
ptr_dcc->filename);
gui_printf (ptr_dcc->server->buffer, _("resumed at position %u\n"),
ptr_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
gui_printf (server->buffer,
@@ -624,7 +624,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (server->buffer, ", ");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
gui_printf (server->buffer, _(" bytes\n"));
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_FILE_SEND)
{
@@ -638,7 +638,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (server->buffer, "), ");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
gui_printf (server->buffer, _(" bytes\n"));
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_CHAT_RECV)
{
@@ -650,20 +650,20 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
"%d.%d.%d.%d",
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")\n");
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_CHAT_SEND)
{
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("Sending DCC chat request to "));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s\n", nick);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (DCC_IS_FILE(type) && (!new_dcc->local_filename))
{
dcc_close (new_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return NULL;
}
@@ -683,7 +683,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (new_dcc->server->buffer, ") ");
gui_printf (new_dcc->server->buffer, _("will be resumed at position %u\n"),
new_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
/* connect if needed and redraw DCC buffer */
@@ -692,7 +692,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
if (!dcc_connect (new_dcc))
{
dcc_close (new_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return NULL;
}
}
@@ -701,7 +701,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
dcc_accept (new_dcc);
else
dcc_redraw (2);
dcc_redraw (HOTLIST_PRIVATE);
gui_draw_buffer_status (gui_current_window->buffer, 0);
return new_dcc;
@@ -1033,7 +1033,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
else
{
dcc_close (ptr_dcc, DCC_ABORTED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
}
@@ -1062,7 +1062,7 @@ dcc_handle ()
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
}
@@ -1089,21 +1089,21 @@ dcc_handle ()
if (sock < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
}
}
@@ -1130,19 +1130,19 @@ dcc_handle ()
if (sock < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
dcc_channel_for_chat (ptr_dcc);
}
}
@@ -1173,14 +1173,14 @@ dcc_handle ()
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (write (ptr_dcc->file, buffer, num_read) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
@@ -1191,10 +1191,10 @@ dcc_handle ()
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_redraw (0);
dcc_redraw (HOTLIST_LOW);
}
}
if (ptr_dcc->type == DCC_FILE_SEND)
@@ -1207,7 +1207,7 @@ dcc_handle ()
"max is %d.\n"),
sizeof (buffer));
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (ptr_dcc->pos > ptr_dcc->ack)
@@ -1219,7 +1219,7 @@ dcc_handle ()
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (num_read < 4)
@@ -1231,7 +1231,7 @@ dcc_handle ()
&& (ptr_dcc->ack >= ptr_dcc->size))
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
}
@@ -1243,20 +1243,20 @@ dcc_handle ()
if (num_read < 1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
if (num_sent < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (0);
dcc_redraw (HOTLIST_LOW);
}
}
}
+2 -2
View File
@@ -185,7 +185,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *arguments)
gui_printf (server->buffer, _("by"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
" %s\n", host);
hotlist_add (2, server->buffer);
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
@@ -996,7 +996,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
(strcasecmp (host, "chanserv") != 0) &&
(strcasecmp (host, "memoserv") != 0))
{
hotlist_add (2, server->buffer);
hotlist_add (HOTLIST_PRIVATE, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+2 -1
View File
@@ -4,7 +4,8 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2005-07-13
Versoin 0.1.4 (under dev!):
Version 0.1.4 (under dev!):
* added color for private in hotlist (different than color for highlight)
* added DCC resume and timeout
* added function for Perl/Python to get DCC list
* fixed FIFO pipe (command now authorized on a buffer not connected
+293 -266
View File
File diff suppressed because it is too large Load Diff
+295 -266
View File
File diff suppressed because it is too large Load Diff
+296 -269
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -23,12 +23,17 @@
#include "../irc/irc.h"
#define HOTLIST_LOW 0
#define HOTLIST_MSG 1
#define HOTLIST_PRIVATE 2
#define HOTLIST_HIGHLIGHT 3
typedef struct t_weechat_hotlist t_weechat_hotlist;
struct t_weechat_hotlist
{
int priority; /* 0=crappy msg (join/part), 1=msg, */
/* 2=nick highlight */
/* 2=pv, 3=nick highlight */
t_gui_buffer *buffer; /* associated buffer */
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
+6 -1
View File
@@ -203,6 +203,7 @@ int cfg_col_chat_bg;
int cfg_col_status;
int cfg_col_status_delimiters;
int cfg_col_status_data_msg;
int cfg_col_status_data_private;
int cfg_col_status_data_highlight;
int cfg_col_status_data_other;
int cfg_col_status_more;
@@ -305,10 +306,14 @@ t_config_option weechat_options_colors[] =
N_("color for window with new messages (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
{ "col_status_private", N_("color for window with private message"),
N_("color for window with private message (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_private, NULL, &config_change_color },
{ "col_status_highlight", N_("color for window with highlight"),
N_("color for window with highlight (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
"lightred", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
{ "col_status_data_other", N_("color for window with new data (not messages)"),
N_("color for window with new data (not messages) (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
+1
View File
@@ -117,6 +117,7 @@ extern int cfg_col_chat_bg;
extern int cfg_col_status;
extern int cfg_col_status_delimiters;
extern int cfg_col_status_data_msg;
extern int cfg_col_status_data_private;
extern int cfg_col_status_data_highlight;
extern int cfg_col_status_data_other;
extern int cfg_col_status_more;
+18 -6
View File
@@ -1254,15 +1254,19 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
{
switch (ptr_hotlist->priority)
{
case 0:
case HOTLIST_LOW:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_OTHER);
break;
case 1:
case HOTLIST_MSG:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_MSG);
break;
case 2:
case HOTLIST_PRIVATE:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_PRIVATE);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
break;
@@ -2278,6 +2282,8 @@ gui_init_colors ()
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_PRIVATE,
cfg_col_status_data_private, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
@@ -2356,6 +2362,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_STATUS - 1] = (cfg_col_status >= 0) ? cfg_col_status & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DELIMITERS - 1] = (cfg_col_status_delimiters >= 0) ? cfg_col_status_delimiters & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_MSG - 1] = (cfg_col_status_data_msg >= 0) ? cfg_col_status_data_msg & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_PRIVATE - 1] = (cfg_col_status_data_private >= 0) ? cfg_col_status_data_private & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_HIGHLIGHT - 1] = (cfg_col_status_data_highlight >= 0) ? cfg_col_status_data_highlight & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_DATA_OTHER - 1] = (cfg_col_status_data_other >= 0) ? cfg_col_status_data_other & A_BOLD : 0;
color_attr[COLOR_WIN_STATUS_MORE - 1] = (cfg_col_status_more >= 0) ? cfg_col_status_more & A_BOLD : 0;
@@ -2547,9 +2554,14 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
buffer->last_line->line_with_highlight <=
buffer->notify_level)
{
hotlist_add (buffer->last_line->line_with_message +
buffer->last_line->line_with_highlight,
buffer);
if (buffer->last_line->line_with_highlight)
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
else if (BUFFER_IS_PRIVATE(buffer))
hotlist_add (HOTLIST_PRIVATE, buffer);
else if (buffer->last_line->line_with_message)
hotlist_add (HOTLIST_MSG, buffer);
else
hotlist_add (HOTLIST_LOW, buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
+31 -30
View File
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 51
#define NUM_COLORS 52
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -41,36 +41,37 @@
#define COLOR_WIN_STATUS 12
#define COLOR_WIN_STATUS_DELIMITERS 13
#define COLOR_WIN_STATUS_DATA_MSG 14
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 15
#define COLOR_WIN_STATUS_DATA_OTHER 16
#define COLOR_WIN_STATUS_MORE 17
#define COLOR_WIN_INFOBAR 18
#define COLOR_WIN_INFOBAR_DELIMITERS 19
#define COLOR_WIN_INFOBAR_HIGHLIGHT 20
#define COLOR_WIN_INPUT 21
#define COLOR_WIN_INPUT_CHANNEL 22
#define COLOR_WIN_INPUT_NICK 23
#define COLOR_WIN_NICK 24
#define COLOR_WIN_NICK_AWAY 25
#define COLOR_WIN_NICK_CHANOWNER 26
#define COLOR_WIN_NICK_CHANADMIN 27
#define COLOR_WIN_NICK_OP 28
#define COLOR_WIN_NICK_HALFOP 29
#define COLOR_WIN_NICK_VOICE 30
#define COLOR_WIN_NICK_MORE 31
#define COLOR_WIN_NICK_SEP 32
#define COLOR_WIN_NICK_SELF 33
#define COLOR_WIN_NICK_PRIVATE 34
#define COLOR_WIN_NICK_FIRST 35
#define COLOR_WIN_NICK_LAST 44
#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_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 45
#define COLOR_DCC_WAITING 46
#define COLOR_DCC_CONNECTING 47
#define COLOR_DCC_ACTIVE 48
#define COLOR_DCC_DONE 49
#define COLOR_DCC_FAILED 50
#define COLOR_DCC_ABORTED 51
#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 SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
+33 -33
View File
@@ -159,7 +159,7 @@ dcc_find_filename (t_irc_dcc *ptr_dcc)
if (!cfg_dcc_auto_rename)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
@@ -167,7 +167,7 @@ dcc_find_filename (t_irc_dcc *ptr_dcc)
if (!filename2)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
ptr_dcc->filename_suffix = 0;
@@ -405,7 +405,7 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
"(maybe private buffer has already DCC CHAT?)\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return;
}
@@ -433,7 +433,7 @@ dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
if (!dcc_connect (ptr_dcc))
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
{
@@ -458,7 +458,7 @@ dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
dcc_channel_for_chat (ptr_dcc);
}
}
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
/*
@@ -477,7 +477,7 @@ dcc_accept (t_irc_dcc *ptr_dcc)
"PRIVMSG %s :\01DCC RESUME %s %d %u\01\r\n",
ptr_dcc->nick, ptr_dcc->filename,
ptr_dcc->port, ptr_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_recv_connect_init (ptr_dcc);
@@ -515,7 +515,7 @@ dcc_accept_resume (t_irc_server *server, char *filename, int port,
ptr_dcc->filename);
gui_printf (ptr_dcc->server->buffer, _("resumed at position %u\n"),
ptr_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
gui_printf (server->buffer,
@@ -624,7 +624,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (server->buffer, ", ");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
gui_printf (server->buffer, _(" bytes\n"));
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_FILE_SEND)
{
@@ -638,7 +638,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (server->buffer, "), ");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
gui_printf (server->buffer, _(" bytes\n"));
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_CHAT_RECV)
{
@@ -650,20 +650,20 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
"%d.%d.%d.%d",
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")\n");
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (type == DCC_CHAT_SEND)
{
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("Sending DCC chat request to "));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s\n", nick);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
if (DCC_IS_FILE(type) && (!new_dcc->local_filename))
{
dcc_close (new_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return NULL;
}
@@ -683,7 +683,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
gui_printf (new_dcc->server->buffer, ") ");
gui_printf (new_dcc->server->buffer, _("will be resumed at position %u\n"),
new_dcc->start_resume);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
/* connect if needed and redraw DCC buffer */
@@ -692,7 +692,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
if (!dcc_connect (new_dcc))
{
dcc_close (new_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
return NULL;
}
}
@@ -701,7 +701,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
dcc_accept (new_dcc);
else
dcc_redraw (2);
dcc_redraw (HOTLIST_PRIVATE);
gui_draw_buffer_status (gui_current_window->buffer, 0);
return new_dcc;
@@ -1033,7 +1033,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
else
{
dcc_close (ptr_dcc, DCC_ABORTED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
}
@@ -1062,7 +1062,7 @@ dcc_handle ()
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
}
@@ -1089,21 +1089,21 @@ dcc_handle ()
if (sock < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
}
}
@@ -1130,19 +1130,19 @@ dcc_handle ()
if (sock < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
dcc_channel_for_chat (ptr_dcc);
}
}
@@ -1173,14 +1173,14 @@ dcc_handle ()
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (write (ptr_dcc->file, buffer, num_read) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
@@ -1191,10 +1191,10 @@ dcc_handle ()
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_redraw (0);
dcc_redraw (HOTLIST_LOW);
}
}
if (ptr_dcc->type == DCC_FILE_SEND)
@@ -1207,7 +1207,7 @@ dcc_handle ()
"max is %d.\n"),
sizeof (buffer));
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (ptr_dcc->pos > ptr_dcc->ack)
@@ -1219,7 +1219,7 @@ dcc_handle ()
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (num_read < 4)
@@ -1231,7 +1231,7 @@ dcc_handle ()
&& (ptr_dcc->ack >= ptr_dcc->size))
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
}
@@ -1243,20 +1243,20 @@ dcc_handle ()
if (num_read < 1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
if (num_sent < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (0);
dcc_redraw (HOTLIST_LOW);
}
}
}
+2 -2
View File
@@ -185,7 +185,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *arguments)
gui_printf (server->buffer, _("by"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
" %s\n", host);
hotlist_add (2, server->buffer);
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
@@ -996,7 +996,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
(strcasecmp (host, "chanserv") != 0) &&
(strcasecmp (host, "memoserv") != 0))
{
hotlist_add (2, server->buffer);
hotlist_add (HOTLIST_PRIVATE, server->buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}