mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 17:45:42 +02:00
Added read marker (indicator for first unread line), added quotes and spaces in config files
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-11-13
|
||||
ChangeLog - 2005-11-19
|
||||
|
||||
|
||||
Version 0.1.7 (under dev!):
|
||||
* added "read marker": an indicator for first unread line in a
|
||||
server or channel buffer
|
||||
* new window maganement: custom size for windows, auto resize when
|
||||
terminal is resized
|
||||
* fixed infinite loop when resizing term to small size
|
||||
|
||||
+385
-373
File diff suppressed because it is too large
Load Diff
+25
-2
@@ -2351,9 +2351,11 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val
|
||||
gui_printf (NULL, _("%s(password hidden) "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
}
|
||||
gui_printf (NULL, "%s%s",
|
||||
gui_printf (NULL, "%s\"%s%s%s\"",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
value2);
|
||||
value2,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
free (value2);
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -2400,6 +2402,27 @@ weechat_cmd_set (char *arguments)
|
||||
{
|
||||
value++;
|
||||
}
|
||||
|
||||
/* remove simple or double quotes
|
||||
and spaces at the end */
|
||||
if (strlen(value) > 1)
|
||||
{
|
||||
pos = value + strlen (value) - 1;
|
||||
while ((pos > value) && (pos[0] == ' '))
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos--;
|
||||
}
|
||||
pos = value + strlen (value) - 1;
|
||||
if (((value[0] == '\'') &&
|
||||
(pos[0] == '\'')) ||
|
||||
((value[0] == '"') &&
|
||||
(pos[0] == '"')))
|
||||
{
|
||||
pos[0] = '\0';
|
||||
value++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -444,11 +444,14 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
option->default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
snprintf (option_string, sizeof (option_string) - 1,
|
||||
"\"%s\"",
|
||||
(option_value) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
option_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+150
-81
File diff suppressed because it is too large
Load Diff
@@ -110,6 +110,7 @@ extern int cfg_look_hotlist_names_level;
|
||||
extern int cfg_look_hotlist_names_length;
|
||||
extern int cfg_look_day_change;
|
||||
extern char *cfg_look_day_change_timestamp;
|
||||
extern char *cfg_look_read_marker;
|
||||
|
||||
extern int cfg_col_real_white;
|
||||
extern int cfg_col_title;
|
||||
@@ -128,6 +129,8 @@ extern int cfg_col_chat_channel;
|
||||
extern int cfg_col_chat_dark;
|
||||
extern int cfg_col_chat_highlight;
|
||||
extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_chat_marker;
|
||||
extern int cfg_col_chat_marker_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_channel;
|
||||
@@ -226,6 +229,7 @@ extern void config_change_noop ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
extern void config_change_read_marker ();
|
||||
extern void config_change_charset ();
|
||||
extern void config_change_one_server_buffer ();
|
||||
extern void config_change_color ();
|
||||
|
||||
@@ -1228,6 +1228,7 @@ int
|
||||
gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulate)
|
||||
{
|
||||
int num_lines, x, y, lines_displayed;
|
||||
int read_marker_x, read_marker_y;
|
||||
int word_start_offset, word_end_offset;
|
||||
int word_length_with_spaces, word_length;
|
||||
int skip_spaces;
|
||||
@@ -1253,6 +1254,18 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
|
||||
window->win_chat_cursor_y = y;
|
||||
}
|
||||
|
||||
/* calculate marker position (maybe not used for this line!) */
|
||||
if (line->ofs_after_date > 0)
|
||||
{
|
||||
saved_char = line->data[line->ofs_after_date - 1];
|
||||
line->data[line->ofs_after_date - 1] = '\0';
|
||||
read_marker_x = x + gui_word_strlen (NULL, line->data);
|
||||
line->data[line->ofs_after_date - 1] = saved_char;
|
||||
}
|
||||
else
|
||||
read_marker_x = x;
|
||||
read_marker_y = y;
|
||||
|
||||
/* reset color & style for a new line */
|
||||
gui_window_chat_reset_style (window);
|
||||
|
||||
@@ -1342,6 +1355,18 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
|
||||
window->win_chat_cursor_x = x;
|
||||
window->win_chat_cursor_y = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* display read marker if needed */
|
||||
if (cfg_look_read_marker && cfg_look_read_marker[0] &&
|
||||
window->buffer->last_read_line &&
|
||||
(window->buffer->last_read_line == line->prev_line))
|
||||
{
|
||||
gui_window_chat_set_weechat_color (window, COLOR_WIN_CHAT_MARKER);
|
||||
mvwprintw (window->win_chat, read_marker_y, read_marker_x,
|
||||
"%c", cfg_look_read_marker[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return lines_displayed;
|
||||
}
|
||||
@@ -2503,6 +2528,13 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
|
||||
if (window->buffer->num_displayed > 0)
|
||||
window->buffer->num_displayed--;
|
||||
|
||||
if (window->buffer != buffer)
|
||||
{
|
||||
window->buffer->last_read_line = window->buffer->last_line;
|
||||
if (buffer->last_read_line == buffer->last_line)
|
||||
buffer->last_read_line = NULL;
|
||||
}
|
||||
|
||||
window->buffer = buffer;
|
||||
window->win_nick_start = 0;
|
||||
gui_calculate_pos_size (window);
|
||||
@@ -3129,6 +3161,7 @@ gui_init_weechat_colors ()
|
||||
gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_MARKER] = gui_color_build (COLOR_WIN_CHAT_MARKER, cfg_col_chat_marker, cfg_col_chat_marker_bg);
|
||||
gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
|
||||
|
||||
+43
-39
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,7 @@ enum t_weechat_color
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
COLOR_WIN_CHAT_DARK,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_MARKER,
|
||||
COLOR_WIN_STATUS,
|
||||
COLOR_WIN_STATUS_DELIMITERS,
|
||||
COLOR_WIN_STATUS_CHANNEL,
|
||||
@@ -228,6 +229,7 @@ struct t_gui_buffer
|
||||
/* chat content (lines, line is composed by many messages) */
|
||||
t_gui_line *lines; /* lines of chat window */
|
||||
t_gui_line *last_line; /* last line of chat window */
|
||||
t_gui_line *last_read_line; /* last read line before jump */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("%sServer: %s%s %s[%s%s%s]\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
server->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
@@ -193,8 +193,9 @@ irc_display_server (t_irc_server *server)
|
||||
_(" (temporary server, will not be saved)") : "");
|
||||
gui_printf (NULL, " server_autoreconnect . . .: %s\n",
|
||||
(server->autoreconnect) ? _("on") : _("off"));
|
||||
gui_printf (NULL, " server_autoreconnect_delay: %d seconds\n",
|
||||
server->autoreconnect_delay);
|
||||
gui_printf (NULL, " server_autoreconnect_delay: %d %s\n",
|
||||
server->autoreconnect_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_address . . . . . .: %s\n",
|
||||
server->address);
|
||||
gui_printf (NULL, " server_port . . . . . . .: %d\n",
|
||||
@@ -221,8 +222,9 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf (NULL, " server_command . . . . . .: %s\n",
|
||||
(server->command && server->command[0]) ?
|
||||
server->command : "");
|
||||
gui_printf (NULL, " server_command_delay . . .: %d seconds\n",
|
||||
server->command_delay);
|
||||
gui_printf (NULL, " server_command_delay . . .: %d %s\n",
|
||||
server->command_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_autojoin . . . . .: %s\n",
|
||||
(server->autojoin && server->autojoin[0]) ?
|
||||
server->autojoin : "");
|
||||
|
||||
@@ -2680,6 +2680,8 @@ irc_cmd_recv_303 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2699,6 +2701,12 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 0;
|
||||
server->away_time = 0;
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2709,6 +2717,8 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2728,6 +2738,15 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,6 +196,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
char *pos, *ptr_away_msg;
|
||||
char *ptr_away_default_msg = "away";
|
||||
t_irc_server *ptr_server;
|
||||
t_gui_window *ptr_window;
|
||||
time_t elapsed;
|
||||
char buffer[4096];
|
||||
char *string;
|
||||
@@ -251,6 +252,13 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
free (string);
|
||||
}
|
||||
server_set_away (ptr_server, ptr_server->nick, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == ptr_server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,6 +299,13 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
server_set_away (server, server->nick, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
|
||||
@@ -219,12 +219,50 @@ plugin_config_read ()
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
|
||||
/* remove spaces before '=' */
|
||||
pos2 = pos - 2;
|
||||
while ((pos2 > line) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
|
||||
/* skip spaces after '=' */
|
||||
while (pos[0] && (pos[0] == ' '))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* remove CR/LF */
|
||||
pos2 = strchr (pos, '\r');
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, '\n');
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* remove simple or double quotes
|
||||
and spaces at the end */
|
||||
if (strlen(pos) > 1)
|
||||
{
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
while ((pos2 > pos) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
if (((pos[0] == '\'') &&
|
||||
(pos2[0] == '\'')) ||
|
||||
((pos[0] == '"') &&
|
||||
(pos2[0] == '"')))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
plugin_config_set_internal (ptr_line, pos);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +317,7 @@ plugin_config_write ()
|
||||
for (ptr_plugin_option = plugin_options; ptr_plugin_option;
|
||||
ptr_plugin_option = ptr_plugin_option->next_option)
|
||||
{
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
ptr_plugin_option->option_name,
|
||||
ptr_plugin_option->value);
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-11-13
|
||||
ChangeLog - 2005-11-19
|
||||
|
||||
|
||||
Version 0.1.7 (under dev!):
|
||||
* added "read marker": an indicator for first unread line in a
|
||||
server or channel buffer
|
||||
* new window maganement: custom size for windows, auto resize when
|
||||
terminal is resized
|
||||
* fixed infinite loop when resizing term to small size
|
||||
|
||||
+386
-374
File diff suppressed because it is too large
Load Diff
+386
-374
File diff suppressed because it is too large
Load Diff
+388
-374
File diff suppressed because it is too large
Load Diff
+385
-373
File diff suppressed because it is too large
Load Diff
@@ -2351,9 +2351,11 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val
|
||||
gui_printf (NULL, _("%s(password hidden) "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
}
|
||||
gui_printf (NULL, "%s%s",
|
||||
gui_printf (NULL, "%s\"%s%s%s\"",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
value2);
|
||||
value2,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
free (value2);
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -2400,6 +2402,27 @@ weechat_cmd_set (char *arguments)
|
||||
{
|
||||
value++;
|
||||
}
|
||||
|
||||
/* remove simple or double quotes
|
||||
and spaces at the end */
|
||||
if (strlen(value) > 1)
|
||||
{
|
||||
pos = value + strlen (value) - 1;
|
||||
while ((pos > value) && (pos[0] == ' '))
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos--;
|
||||
}
|
||||
pos = value + strlen (value) - 1;
|
||||
if (((value[0] == '\'') &&
|
||||
(pos[0] == '\'')) ||
|
||||
((value[0] == '"') &&
|
||||
(pos[0] == '"')))
|
||||
{
|
||||
pos[0] = '\0';
|
||||
value++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -444,11 +444,14 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
option->default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
snprintf (option_string, sizeof (option_string) - 1,
|
||||
"\"%s\"",
|
||||
(option_value) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
option_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+150
-81
File diff suppressed because it is too large
Load Diff
@@ -110,6 +110,7 @@ extern int cfg_look_hotlist_names_level;
|
||||
extern int cfg_look_hotlist_names_length;
|
||||
extern int cfg_look_day_change;
|
||||
extern char *cfg_look_day_change_timestamp;
|
||||
extern char *cfg_look_read_marker;
|
||||
|
||||
extern int cfg_col_real_white;
|
||||
extern int cfg_col_title;
|
||||
@@ -128,6 +129,8 @@ extern int cfg_col_chat_channel;
|
||||
extern int cfg_col_chat_dark;
|
||||
extern int cfg_col_chat_highlight;
|
||||
extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_chat_marker;
|
||||
extern int cfg_col_chat_marker_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_channel;
|
||||
@@ -226,6 +229,7 @@ extern void config_change_noop ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
extern void config_change_read_marker ();
|
||||
extern void config_change_charset ();
|
||||
extern void config_change_one_server_buffer ();
|
||||
extern void config_change_color ();
|
||||
|
||||
@@ -1228,6 +1228,7 @@ int
|
||||
gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulate)
|
||||
{
|
||||
int num_lines, x, y, lines_displayed;
|
||||
int read_marker_x, read_marker_y;
|
||||
int word_start_offset, word_end_offset;
|
||||
int word_length_with_spaces, word_length;
|
||||
int skip_spaces;
|
||||
@@ -1253,6 +1254,18 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
|
||||
window->win_chat_cursor_y = y;
|
||||
}
|
||||
|
||||
/* calculate marker position (maybe not used for this line!) */
|
||||
if (line->ofs_after_date > 0)
|
||||
{
|
||||
saved_char = line->data[line->ofs_after_date - 1];
|
||||
line->data[line->ofs_after_date - 1] = '\0';
|
||||
read_marker_x = x + gui_word_strlen (NULL, line->data);
|
||||
line->data[line->ofs_after_date - 1] = saved_char;
|
||||
}
|
||||
else
|
||||
read_marker_x = x;
|
||||
read_marker_y = y;
|
||||
|
||||
/* reset color & style for a new line */
|
||||
gui_window_chat_reset_style (window);
|
||||
|
||||
@@ -1342,6 +1355,18 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
|
||||
window->win_chat_cursor_x = x;
|
||||
window->win_chat_cursor_y = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* display read marker if needed */
|
||||
if (cfg_look_read_marker && cfg_look_read_marker[0] &&
|
||||
window->buffer->last_read_line &&
|
||||
(window->buffer->last_read_line == line->prev_line))
|
||||
{
|
||||
gui_window_chat_set_weechat_color (window, COLOR_WIN_CHAT_MARKER);
|
||||
mvwprintw (window->win_chat, read_marker_y, read_marker_x,
|
||||
"%c", cfg_look_read_marker[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return lines_displayed;
|
||||
}
|
||||
@@ -2503,6 +2528,13 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
|
||||
if (window->buffer->num_displayed > 0)
|
||||
window->buffer->num_displayed--;
|
||||
|
||||
if (window->buffer != buffer)
|
||||
{
|
||||
window->buffer->last_read_line = window->buffer->last_line;
|
||||
if (buffer->last_read_line == buffer->last_line)
|
||||
buffer->last_read_line = NULL;
|
||||
}
|
||||
|
||||
window->buffer = buffer;
|
||||
window->win_nick_start = 0;
|
||||
gui_calculate_pos_size (window);
|
||||
@@ -3129,6 +3161,7 @@ gui_init_weechat_colors ()
|
||||
gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_MARKER] = gui_color_build (COLOR_WIN_CHAT_MARKER, cfg_col_chat_marker, cfg_col_chat_marker_bg);
|
||||
gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
|
||||
gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,7 @@ enum t_weechat_color
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
COLOR_WIN_CHAT_DARK,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_MARKER,
|
||||
COLOR_WIN_STATUS,
|
||||
COLOR_WIN_STATUS_DELIMITERS,
|
||||
COLOR_WIN_STATUS_CHANNEL,
|
||||
@@ -228,6 +229,7 @@ struct t_gui_buffer
|
||||
/* chat content (lines, line is composed by many messages) */
|
||||
t_gui_line *lines; /* lines of chat window */
|
||||
t_gui_line *last_line; /* last line of chat window */
|
||||
t_gui_line *last_read_line; /* last read line before jump */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("%sServer: %s%s %s[%s%s%s]\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
server->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
@@ -193,8 +193,9 @@ irc_display_server (t_irc_server *server)
|
||||
_(" (temporary server, will not be saved)") : "");
|
||||
gui_printf (NULL, " server_autoreconnect . . .: %s\n",
|
||||
(server->autoreconnect) ? _("on") : _("off"));
|
||||
gui_printf (NULL, " server_autoreconnect_delay: %d seconds\n",
|
||||
server->autoreconnect_delay);
|
||||
gui_printf (NULL, " server_autoreconnect_delay: %d %s\n",
|
||||
server->autoreconnect_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_address . . . . . .: %s\n",
|
||||
server->address);
|
||||
gui_printf (NULL, " server_port . . . . . . .: %d\n",
|
||||
@@ -221,8 +222,9 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf (NULL, " server_command . . . . . .: %s\n",
|
||||
(server->command && server->command[0]) ?
|
||||
server->command : "");
|
||||
gui_printf (NULL, " server_command_delay . . .: %d seconds\n",
|
||||
server->command_delay);
|
||||
gui_printf (NULL, " server_command_delay . . .: %d %s\n",
|
||||
server->command_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_autojoin . . . . .: %s\n",
|
||||
(server->autojoin && server->autojoin[0]) ?
|
||||
server->autojoin : "");
|
||||
|
||||
@@ -2680,6 +2680,8 @@ irc_cmd_recv_303 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2699,6 +2701,12 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 0;
|
||||
server->away_time = 0;
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2709,6 +2717,8 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2728,6 +2738,15 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,6 +196,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
char *pos, *ptr_away_msg;
|
||||
char *ptr_away_default_msg = "away";
|
||||
t_irc_server *ptr_server;
|
||||
t_gui_window *ptr_window;
|
||||
time_t elapsed;
|
||||
char buffer[4096];
|
||||
char *string;
|
||||
@@ -251,6 +252,13 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
free (string);
|
||||
}
|
||||
server_set_away (ptr_server, ptr_server->nick, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == ptr_server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,6 +299,13 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
server_set_away (server, server->nick, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
|
||||
@@ -219,12 +219,50 @@ plugin_config_read ()
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
|
||||
/* remove spaces before '=' */
|
||||
pos2 = pos - 2;
|
||||
while ((pos2 > line) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
|
||||
/* skip spaces after '=' */
|
||||
while (pos[0] && (pos[0] == ' '))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* remove CR/LF */
|
||||
pos2 = strchr (pos, '\r');
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, '\n');
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* remove simple or double quotes
|
||||
and spaces at the end */
|
||||
if (strlen(pos) > 1)
|
||||
{
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
while ((pos2 > pos) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
if (((pos[0] == '\'') &&
|
||||
(pos2[0] == '\'')) ||
|
||||
((pos[0] == '"') &&
|
||||
(pos2[0] == '"')))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
plugin_config_set_internal (ptr_line, pos);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +317,7 @@ plugin_config_write ()
|
||||
for (ptr_plugin_option = plugin_options; ptr_plugin_option;
|
||||
ptr_plugin_option = ptr_plugin_option->next_option)
|
||||
{
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
ptr_plugin_option->option_name,
|
||||
ptr_plugin_option->value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user