aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-07 19:39:02 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-07 19:39:02 +0200
commit2c95c406f41c10e7e2f40095f3524c3f36a99da1 (patch)
treedc5c0bf219b79df62186a9154a31547cbc3b3bc2 /degesch.c
parent62c55858d0eb6bf7800f5f9777e43232f131d949 (diff)
downloadxK-2c95c406f41c10e7e2f40095f3524c3f36a99da1.tar.gz
xK-2c95c406f41c10e7e2f40095f3524c3f36a99da1.tar.xz
xK-2c95c406f41c10e7e2f40095f3524c3f36a99da1.zip
degesch: colour the user@host part
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/degesch.c b/degesch.c
index a2d6ece..4a9a83a 100644
--- a/degesch.c
+++ b/degesch.c
@@ -27,6 +27,7 @@
XX( TIMESTAMP, "timestamp", "Terminal attributes for timestamps" ) \
XX( HIGHLIGHT, "highlight", "Terminal attributes for highlights" ) \
XX( ACTION, "action", "Terminal attributes for user actions" ) \
+ XX( USERHOST, "userhost", "Terminal attributes for user@host" ) \
XX( JOIN, "join", "Terminal attributes for joins" ) \
XX( PART, "part", "Terminal attributes for parts" )
@@ -1591,6 +1592,7 @@ init_colors (struct app_context *ctx)
INIT_ATTR (EXTERNAL, g_terminal.color_set_fg[COLOR_WHITE]);
INIT_ATTR (TIMESTAMP, g_terminal.color_set_fg[COLOR_WHITE]);
INIT_ATTR (ACTION, g_terminal.color_set_fg[COLOR_RED]);
+ INIT_ATTR (USERHOST, g_terminal.color_set_fg[COLOR_CYAN]);
INIT_ATTR (JOIN, g_terminal.color_set_fg[COLOR_GREEN]);
INIT_ATTR (PART, g_terminal.color_set_fg[COLOR_RED]);
@@ -2050,22 +2052,22 @@ buffer_line_display (struct app_context *ctx,
break;
case BUFFER_LINE_JOIN:
formatter_add (&f, "#a-->#r ", ATTR_JOIN);
- formatter_add (&f, "#c#s#r (#s) #a#s#r #s",
- nick_color, nick, userhost,
+ formatter_add (&f, "#c#s#r (#a#s#r) #a#s#r #s",
+ nick_color, nick, ATTR_USERHOST, userhost,
ATTR_JOIN, "has joined", a->object);
break;
case BUFFER_LINE_PART:
formatter_add (&f, "#a<--#r ", ATTR_PART);
- formatter_add (&f, "#c#s#r (#s) #a#s#r #s",
- nick_color, nick, userhost,
+ formatter_add (&f, "#c#s#r (#a#s#r) #a#s#r #s",
+ nick_color, nick, ATTR_USERHOST, userhost,
ATTR_PART, "has left", a->object);
if (a->reason)
formatter_add (&f, " (#s)", a->reason);
break;
case BUFFER_LINE_KICK:
formatter_add (&f, "#a<--#r ", ATTR_PART);
- formatter_add (&f, "#c#s#r (#s) #a#s#r #c#s#r",
- nick_color, nick, userhost,
+ formatter_add (&f, "#c#s#r (#a#s#r) #a#s#r #c#s#r",
+ nick_color, nick, ATTR_USERHOST, userhost,
ATTR_PART, "has kicked", object_color, a->object);
if (a->reason)
formatter_add (&f, " (#s)", a->reason);
@@ -2088,8 +2090,8 @@ buffer_line_display (struct app_context *ctx,
break;
case BUFFER_LINE_QUIT:
formatter_add (&f, "#a<--#r ", ATTR_PART);
- formatter_add (&f, "#c#s#r (%s) #a#s#r",
- nick_color, nick, userhost,
+ formatter_add (&f, "#c#s#r (#a%s#r) #a#s#r",
+ nick_color, nick, ATTR_USERHOST, userhost,
ATTR_PART, "has quit");
if (a->reason)
formatter_add (&f, " (#s)", a->reason);