1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 06:06:45 +02:00

added groupchat actions

This commit is contained in:
Jfreegman
2013-12-13 20:57:32 -05:00
parent 8b1dbd44ba
commit 34cc4314a5
7 changed files with 101 additions and 46 deletions

View File

@ -26,14 +26,15 @@ static int num_selected = 0;
ToxicFriend friends[MAX_FRIENDS_NUM];
static int friendlist_index[MAX_FRIENDS_NUM] = {0};
#define S_WEIGHT 100
static int index_name_cmp(const void *n1, const void *n2)
{
int res = qsort_strcasecmp_hlpr(friends[*(int *) n1].name, friends[*(int *) n2].name);
int k = 100;
/* Use weight to make qsort always put online friends before offline */
res = friends[*(int *) n1].online ? (res - k) : (res + k);
res = friends[*(int *) n2].online ? (res + k) : (res - k);
res = friends[*(int *) n1].online ? (res - S_WEIGHT) : (res + S_WEIGHT);
res = friends[*(int *) n2].online ? (res + S_WEIGHT) : (res - S_WEIGHT);
return res;
}