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

Improved display: align messages after prefixes (for example: "-@-" or "-=-")

This commit is contained in:
Sebastien Helleu
2005-02-26 11:52:40 +00:00
parent 7596736ae9
commit 64c33a8295
8 changed files with 20 additions and 24 deletions
+1 -5
View File
@@ -2220,7 +2220,6 @@ gui_init ()
curs_set (1);
keypad (stdscr, TRUE);
noecho ();
/*nonl();*/
nodelay (stdscr, TRUE);
gui_init_colors ();
@@ -2329,7 +2328,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
buffer->last_line->line_with_message = 1;
if (type & MSG_TYPE_HIGHLIGHT)
buffer->last_line->line_with_highlight = 1;
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK))
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK) || (type & MSG_TYPE_PREFIX))
buffer->last_line->length_align += length;
if (type & MSG_TYPE_NOLOG)
buffer->last_line->log_write = 0;
@@ -2458,9 +2457,6 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
if (pos && !pos[1])
pos = NULL;
}
/*wrefresh (buffer->window->win_chat);
refresh ();*/
}
else
printf ("%s", buf3);
+6 -5
View File
@@ -78,11 +78,12 @@
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
#define MSG_TYPE_TIME 1
#define MSG_TYPE_NICK 2
#define MSG_TYPE_INFO 4
#define MSG_TYPE_MSG 8
#define MSG_TYPE_HIGHLIGHT 16
#define MSG_TYPE_NOLOG 32
#define MSG_TYPE_PREFIX 2
#define MSG_TYPE_NICK 4
#define MSG_TYPE_INFO 8
#define MSG_TYPE_MSG 16
#define MSG_TYPE_HIGHLIGHT 32
#define MSG_TYPE_NOLOG 64
#define gui_printf_color(buffer, color, fmt, argz...) \
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
+2 -1
View File
@@ -45,7 +45,8 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
{
int type;
type = MSG_TYPE_INFO;
type = MSG_TYPE_INFO | MSG_TYPE_PREFIX;
if (!cfg_log_plugin_msg && (prefix == PREFIX_PLUGIN))
type |= MSG_TYPE_NOLOG;
+1 -1
View File
@@ -2973,7 +2973,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_INFO, 0, 0, 1);
MSG_TYPE_MSG, 0, 0, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
}
+1 -5
View File
@@ -2220,7 +2220,6 @@ gui_init ()
curs_set (1);
keypad (stdscr, TRUE);
noecho ();
/*nonl();*/
nodelay (stdscr, TRUE);
gui_init_colors ();
@@ -2329,7 +2328,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
buffer->last_line->line_with_message = 1;
if (type & MSG_TYPE_HIGHLIGHT)
buffer->last_line->line_with_highlight = 1;
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK))
if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK) || (type & MSG_TYPE_PREFIX))
buffer->last_line->length_align += length;
if (type & MSG_TYPE_NOLOG)
buffer->last_line->log_write = 0;
@@ -2458,9 +2457,6 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
if (pos && !pos[1])
pos = NULL;
}
/*wrefresh (buffer->window->win_chat);
refresh ();*/
}
else
printf ("%s", buf3);
+6 -5
View File
@@ -78,11 +78,12 @@
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
#define MSG_TYPE_TIME 1
#define MSG_TYPE_NICK 2
#define MSG_TYPE_INFO 4
#define MSG_TYPE_MSG 8
#define MSG_TYPE_HIGHLIGHT 16
#define MSG_TYPE_NOLOG 32
#define MSG_TYPE_PREFIX 2
#define MSG_TYPE_NICK 4
#define MSG_TYPE_INFO 8
#define MSG_TYPE_MSG 16
#define MSG_TYPE_HIGHLIGHT 32
#define MSG_TYPE_NOLOG 64
#define gui_printf_color(buffer, color, fmt, argz...) \
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
+2 -1
View File
@@ -45,7 +45,8 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
{
int type;
type = MSG_TYPE_INFO;
type = MSG_TYPE_INFO | MSG_TYPE_PREFIX;
if (!cfg_log_plugin_msg && (prefix == PREFIX_PLUGIN))
type |= MSG_TYPE_NOLOG;
+1 -1
View File
@@ -2973,7 +2973,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_INFO, 0, 0, 1);
MSG_TYPE_MSG, 0, 0, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
}