1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

Added nick alignment in private buffers

This commit is contained in:
Sebastien Helleu
2006-04-03 09:35:08 +00:00
parent 08b0272a9b
commit 212ec7a76d
18 changed files with 1930 additions and 1956 deletions
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+9 -12
View File
@@ -1008,13 +1008,8 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
if (CHANNEL(buffer)->type == CHANNEL_TYPE_PRIVATE)
{
gui_printf_type (buffer,
MSG_TYPE_NICK,
"%s<%s%s%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_NICK_SELF),
server->nick,
GUI_COLOR(COLOR_WIN_CHAT_DARK));
irc_display_nick (buffer, NULL, server->nick,
MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0);
gui_printf_type (buffer,
MSG_TYPE_MSG,
"%s%s\n",
@@ -1028,11 +1023,13 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
if (ptr_nick)
{
irc_display_nick (buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf (buffer,
"%s\n",
(command_with_colors2) ?
command_with_colors2 : command);
MSG_TYPE_NICK, 1, -1, 0);
gui_printf_type (buffer,
MSG_TYPE_MSG,
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
(command_with_colors2) ?
command_with_colors2 : command);
}
else
{
+6 -6
View File
@@ -143,12 +143,11 @@ irc_display_prefix (t_irc_server *server, t_gui_buffer *buffer, char *prefix)
/*
* irc_display_nick: display nick in chat window
* if color_nick < 0 then nick is highlighted
*/
void
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
int type, int display_around, int color_nick, int no_nickmode)
int type, int display_around, int force_color, int no_nickmode)
{
char format[32], *ptr_nickname;
int i, nickname_length, external_nick, length, spaces, disable_prefix_suffix;
@@ -243,10 +242,11 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
gui_printf_type_nick (buffer, type,
(nick) ? nick->nick : nickname,
"%s%s",
(color_nick < 0) ?
GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT) :
GUI_COLOR((nick && color_nick) ?
nick->color : COLOR_WIN_CHAT),
(force_color >= 0) ?
GUI_COLOR(force_color) :
GUI_COLOR((nick) ? nick->color :
(buffer && BUFFER_IS_PRIVATE(buffer)) ?
COLOR_WIN_NICK_PRIVATE : COLOR_WIN_CHAT),
ptr_nickname);
if (display_around && (spaces < 0))
gui_printf_type (buffer, type, "%s+",
+12 -22
View File
@@ -1774,7 +1774,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
1, COLOR_WIN_CHAT_HIGHLIGHT, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
@@ -1796,7 +1796,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s\n", pos);
}
@@ -2355,18 +2355,17 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if (!ptr_channel->topic)
ptr_channel->topic = strdup (host2);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s<",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
if (irc_is_highlight (pos, server->nick))
irc_display_nick (ptr_channel->buffer, NULL, nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1,
COLOR_WIN_CHAT_HIGHLIGHT, 0);
else
irc_display_nick (ptr_channel->buffer, NULL, nick,
MSG_TYPE_NICK, 1, -1, 0);
if (irc_is_highlight (pos, server->nick))
{
gui_printf_type (ptr_channel->buffer,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
"%s%s",
GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT),
nick);
if ( (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
if ((cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer))
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
@@ -2375,16 +2374,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
highlight = 1;
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s%s",
GUI_COLOR(COLOR_WIN_NICK_PRIVATE),
nick);
highlight = 0;
}
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
@@ -4713,7 +4703,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *nick, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_MSG, 0, 0, 1);
MSG_TYPE_MSG, 0, COLOR_WIN_CHAT, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
}
+3 -3
View File
@@ -209,7 +209,7 @@ irc_cmd_send_amsg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)arguments, 1);
gui_printf (ptr_channel->buffer, "%s\n", (string) ? string : arguments);
if (string)
@@ -1283,7 +1283,7 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel,
ptr_nick = NULL;
irc_display_nick (buffer, ptr_nick,
(ptr_nick) ? NULL : server->nick,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
gui_printf_type (buffer, MSG_TYPE_MSG, "%s\n",
(string) ? string : "");
@@ -1303,7 +1303,7 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s\n",
(string) ? string : "");
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+187 -187
View File
File diff suppressed because it is too large Load Diff
+9 -12
View File
@@ -1008,13 +1008,8 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
if (CHANNEL(buffer)->type == CHANNEL_TYPE_PRIVATE)
{
gui_printf_type (buffer,
MSG_TYPE_NICK,
"%s<%s%s%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_NICK_SELF),
server->nick,
GUI_COLOR(COLOR_WIN_CHAT_DARK));
irc_display_nick (buffer, NULL, server->nick,
MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0);
gui_printf_type (buffer,
MSG_TYPE_MSG,
"%s%s\n",
@@ -1028,11 +1023,13 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
if (ptr_nick)
{
irc_display_nick (buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf (buffer,
"%s\n",
(command_with_colors2) ?
command_with_colors2 : command);
MSG_TYPE_NICK, 1, -1, 0);
gui_printf_type (buffer,
MSG_TYPE_MSG,
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
(command_with_colors2) ?
command_with_colors2 : command);
}
else
{
+6 -6
View File
@@ -143,12 +143,11 @@ irc_display_prefix (t_irc_server *server, t_gui_buffer *buffer, char *prefix)
/*
* irc_display_nick: display nick in chat window
* if color_nick < 0 then nick is highlighted
*/
void
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
int type, int display_around, int color_nick, int no_nickmode)
int type, int display_around, int force_color, int no_nickmode)
{
char format[32], *ptr_nickname;
int i, nickname_length, external_nick, length, spaces, disable_prefix_suffix;
@@ -243,10 +242,11 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
gui_printf_type_nick (buffer, type,
(nick) ? nick->nick : nickname,
"%s%s",
(color_nick < 0) ?
GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT) :
GUI_COLOR((nick && color_nick) ?
nick->color : COLOR_WIN_CHAT),
(force_color >= 0) ?
GUI_COLOR(force_color) :
GUI_COLOR((nick) ? nick->color :
(buffer && BUFFER_IS_PRIVATE(buffer)) ?
COLOR_WIN_NICK_PRIVATE : COLOR_WIN_CHAT),
ptr_nickname);
if (display_around && (spaces < 0))
gui_printf_type (buffer, type, "%s+",
+12 -22
View File
@@ -1774,7 +1774,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
1, COLOR_WIN_CHAT_HIGHLIGHT, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
@@ -1796,7 +1796,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s\n", pos);
}
@@ -2355,18 +2355,17 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if (!ptr_channel->topic)
ptr_channel->topic = strdup (host2);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s<",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
if (irc_is_highlight (pos, server->nick))
irc_display_nick (ptr_channel->buffer, NULL, nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1,
COLOR_WIN_CHAT_HIGHLIGHT, 0);
else
irc_display_nick (ptr_channel->buffer, NULL, nick,
MSG_TYPE_NICK, 1, -1, 0);
if (irc_is_highlight (pos, server->nick))
{
gui_printf_type (ptr_channel->buffer,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
"%s%s",
GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT),
nick);
if ( (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
if ((cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer))
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
@@ -2375,16 +2374,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
highlight = 1;
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s%s",
GUI_COLOR(COLOR_WIN_NICK_PRIVATE),
nick);
highlight = 0;
}
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
@@ -4713,7 +4703,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *nick, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_MSG, 0, 0, 1);
MSG_TYPE_MSG, 0, COLOR_WIN_CHAT, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
}
+3 -3
View File
@@ -209,7 +209,7 @@ irc_cmd_send_amsg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)arguments, 1);
gui_printf (ptr_channel->buffer, "%s\n", (string) ? string : arguments);
if (string)
@@ -1283,7 +1283,7 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel,
ptr_nick = NULL;
irc_display_nick (buffer, ptr_nick,
(ptr_nick) ? NULL : server->nick,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
gui_printf_type (buffer, MSG_TYPE_MSG, "%s\n",
(string) ? string : "");
@@ -1303,7 +1303,7 @@ irc_cmd_send_msg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s\n",
(string) ? string : "");