From 6429312022afec02396e4c4feff5c926f415c3fe Mon Sep 17 00:00:00 2001 From: ketmar Date: Sat, 28 Sep 2013 18:48:51 +0300 Subject: [PATCH] fixes in hidden contact visibility --- html/js/clist.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/html/js/clist.js b/html/js/clist.js index a3dbdd8..995869e 100644 --- a/html/js/clist.js +++ b/html/js/clist.js @@ -13,6 +13,21 @@ var flgOffVisModePerson = true; var flgHiddenVisMode = true; var globalCnt = 1; + +// statuses +const stInternal = 0; +const stOffline = 1; +const stVacation = 2; +const stAway = 3; +// others are avail +const stDND = 4; +const stNearby = 5; +const stBusy = 6; +const stHere = 7; +const stFFC = 8; // free-for-chat (talkative) +const stRealtime = 9; // unused + + /* * */ @@ -578,15 +593,17 @@ function addContactDiv (user) { function getContactVisibility (uu) { - if (uu.unread || uu.chatting || uu.showAlways || uu.editing) return true; - /* is contact is offline and corresponding 'show offline' mode is off -- hide it */ - if (uu.status <= 1) { - if (uu.place && flgOffVisModeRoom) return true; - if (!uu.place && flgOffVisModePerson) return true; + if (uu.chatting || uu.showAlways || uu.editing) return true; + if (uu.hidden && !flgHiddenVisMode) { + /* hidden contact */ + if (uu.unread && !uu.skipUnreadCycle) return true; return false; } - if (uu.hidden && !flgHiddenVisMode) return false; /* this contact is hidden */ - /* show it */ + /* have unread messages? */ + if (uu.unread && !uu.skipUnreadCycle) return true; + /* is contact is offline? */ + if (uu.status <= stOffline) return ((uu.place && flgOffVisModeRoom) || (!uu.place && flgOffVisModePerson)); /* is corresponding 'show offline' mode is off? */ + /* this contact is online and not hidden: show it */ return true; } -- 2.11.4.GIT