aboutsummaryrefslogtreecommitdiff
path: root/weechat
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-13 22:08:48 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-13 22:08:48 +0200
commitac99b8ffc7f56889fdd8e15d73be0581a66d71f2 (patch)
tree5c41667298d558cc14b34223cebe8c60153b5e5e /weechat
parent61b283f2e9a8343267ffd0280bacc1369075b763 (diff)
weechat: Better nicklist colors
Diffstat (limited to 'weechat')
-rw-r--r--weechat/tomsg.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/weechat/tomsg.c b/weechat/tomsg.c
index 676586e..04213ae 100644
--- a/weechat/tomsg.c
+++ b/weechat/tomsg.c
@@ -21,6 +21,10 @@ WEECHAT_PLUGIN_PRIORITY(1000)
static const char *errpfx,*netpfx;
+#define NICK_COLOR "default"
+#define NICK_AWAY_COLOR "weechat.color.nicklist_away"
+
+
struct roomdata{
char *name;
struct t_gui_buffer *buffer;
@@ -147,8 +151,8 @@ static void isonline_net_callback(int fd,struct net_response res,void *payload){
fd,res.type,res.number);
const char *color=
res.type!=NET_NUMBER ? "red" :
- res.number >= 1 ? "weechat.color.chat_nick" :
- "weechat.color.nicklist_away";
+ res.number >= 1 ? NICK_COLOR:
+ NICK_AWAY_COLOR;
struct room_and_name *rn=(struct room_and_name*)payload;
struct roomdata *room=rn->room;
@@ -177,8 +181,8 @@ static void members_net_callback(int fd,struct net_response res,void *payload){
for(int i=0;i<res.nitems;i++){
weechat_nicklist_add_nick(
room->buffer,room->buffer_nickgroup,
- res.items[i],"weechat.color.chat_nick",
- "","weechat.color.chat_nick",
+ res.items[i],NICK_COLOR,
+ "",NICK_COLOR,
1);
struct room_and_name *payload=malloc(sizeof(struct room_and_name));
assert(payload);
@@ -225,8 +229,8 @@ static void push_net_callback(int fd,struct net_response res,void *payload){
if(room->buffer_nickgroup){
weechat_nicklist_add_nick(
room->buffer,room->buffer_nickgroup,
- res.username,"weechat.color.chat_nick",
- "","weechat.color.chat_nick",
+ res.username,NICK_COLOR,
+ "",NICK_COLOR,
1);
}
room->nmembers++;
@@ -241,7 +245,7 @@ static void push_net_callback(int fd,struct net_response res,void *payload){
// ok
} else if(res.type==NET_ONLINE){
debugf(" NET_ONLINE with username='%s' num='%" PRIi64 "'\n",res.online.username,res.online.num);
- const char *color=res.online.num>0 ? "default" : "weechat.color.nicklist_away";
+ const char *color=res.online.num>0 ? NICK_COLOR : NICK_AWAY_COLOR;
for(i64 i=0;i<conn->nrooms;i++){
struct t_gui_nick *nickp=weechat_nicklist_search_nick(
conn->rooms[i]->buffer,conn->rooms[i]->buffer_nickgroup,res.online.username);