Mercurial > hg > nnchat
changeset 538:ffacb78d9b9f
Add colorization of usernames on userlist based on friend/ignore status.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 08 Nov 2012 19:06:32 +0200 |
parents | 1014822abaf1 |
children | 8a52651bb88d |
files | main.c |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Wed Nov 07 09:17:42 2012 +0200 +++ b/main.c Thu Nov 08 19:06:32 2012 +0200 @@ -903,8 +903,17 @@ nncmd_namedata_t *d = data; char name[NAME_ENTRY_SIZE]; size_t len; + int color; - snprintf(name, sizeof(name), "[½3½%-20s½0½] ", user->name); + if (checkNameList(setFriendList, user->name)) + color = 11; + else + if (checkNameList(setIgnoreList, user->name)) + color = 1; + else + color = 3; + + snprintf(name, sizeof(name), "[½%d½%-20s½0½] ", color, user->name); d->total++; if (d->i >= NAME_NUM_PER_LINE)