Mercurial > hg > nnchat
comparison main.c @ 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 | 15e447d6a2a6 |
children | 44f67ec5e945 |
comparison
equal
deleted
inserted
replaced
537:1014822abaf1 | 538:ffacb78d9b9f |
---|---|
901 static int nncmd_names_do(const nn_user_t *user, void *data) | 901 static int nncmd_names_do(const nn_user_t *user, void *data) |
902 { | 902 { |
903 nncmd_namedata_t *d = data; | 903 nncmd_namedata_t *d = data; |
904 char name[NAME_ENTRY_SIZE]; | 904 char name[NAME_ENTRY_SIZE]; |
905 size_t len; | 905 size_t len; |
906 | 906 int color; |
907 snprintf(name, sizeof(name), "[½3½%-20s½0½] ", user->name); | 907 |
908 if (checkNameList(setFriendList, user->name)) | |
909 color = 11; | |
910 else | |
911 if (checkNameList(setIgnoreList, user->name)) | |
912 color = 1; | |
913 else | |
914 color = 3; | |
915 | |
916 snprintf(name, sizeof(name), "[½%d½%-20s½0½] ", color, user->name); | |
908 | 917 |
909 d->total++; | 918 d->total++; |
910 if (d->i >= NAME_NUM_PER_LINE) | 919 if (d->i >= NAME_NUM_PER_LINE) |
911 { | 920 { |
912 printMsgQ(currWin, "%s\n", d->buf); | 921 printMsgQ(currWin, "%s\n", d->buf); |