summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-02-26 11:52:40 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-02-26 11:52:40 +0000
commit64c33a829541791298486504e2c1ec451cf49508 (patch)
tree51de856dfe726f91aa752acb4759f509a472c5ac
parent7596736ae9c8cf364fe937353f4db6a9365ee8cb (diff)
downloadweechat-64c33a829541791298486504e2c1ec451cf49508.zip
Improved display: align messages after prefixes (for example: "-@-" or "-=-")
-rw-r--r--src/gui/curses/gui-display.c6
-rw-r--r--src/gui/gui.h11
-rw-r--r--src/irc/irc-display.c3
-rw-r--r--src/irc/irc-recv.c2
-rw-r--r--weechat/src/gui/curses/gui-display.c6
-rw-r--r--weechat/src/gui/gui.h11
-rw-r--r--weechat/src/irc/irc-display.c3
-rw-r--r--weechat/src/irc/irc-recv.c2
8 files changed, 20 insertions, 24 deletions
diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c
index 5ed25c2cd..679c90372 100644
--- a/src/gui/curses/gui-display.c
+++ b/src/gui/curses/gui-display.c
@@ -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);
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 06edb434b..7c7ddbc6e 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -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)
diff --git a/src/irc/irc-display.c b/src/irc/irc-display.c
index 6bcd216b8..ec5f135b0 100644
--- a/src/irc/irc-display.c
+++ b/src/irc/irc-display.c
@@ -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;
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 8f917d30c..6b34d4cd2 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -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, " ");
}
diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c
index 5ed25c2cd..679c90372 100644
--- a/weechat/src/gui/curses/gui-display.c
+++ b/weechat/src/gui/curses/gui-display.c
@@ -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);
diff --git a/weechat/src/gui/gui.h b/weechat/src/gui/gui.h
index 06edb434b..7c7ddbc6e 100644
--- a/weechat/src/gui/gui.h
+++ b/weechat/src/gui/gui.h
@@ -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)
diff --git a/weechat/src/irc/irc-display.c b/weechat/src/irc/irc-display.c
index 6bcd216b8..ec5f135b0 100644
--- a/weechat/src/irc/irc-display.c
+++ b/weechat/src/irc/irc-display.c
@@ -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;
diff --git a/weechat/src/irc/irc-recv.c b/weechat/src/irc/irc-recv.c
index 8f917d30c..6b34d4cd2 100644
--- a/weechat/src/irc/irc-recv.c
+++ b/weechat/src/irc/irc-recv.c
@@ -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, " ");
}