add online status to friends overview

This commit is contained in:
2019-07-19 16:09:28 +02:00
parent 5febc2061c
commit b879151e07
5 changed files with 59 additions and 4 deletions

View File

@@ -12,11 +12,19 @@ ncdc_cmd_friends_list(ncdc_mainwindow_t n, size_t ac,
LOG(n, L"/FRIENDS list");
for (i = 0; i < dc_account_friends_size(current_account); i++) {
dc_account_t acc = dc_account_nth_friend(current_account, i);
char const *status = dc_account_status(acc);
if (status == NULL) {
status = "offline";
}
switch (dc_account_friend_state(acc)) {
case FRIEND_STATE_FRIEND: c = 'F'; break;
case FRIEND_STATE_PENDING: c = 'P'; break;
default: c = ' '; break;
}
LOG(n, L" %c %s", c, dc_account_fullname(acc));
LOG(n, L" [%c] [%-7s] %s", c, status, dc_account_fullname(acc));
}
LOG(n, L"End of /FRIENDS list");