2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

improved libappindicator load, making user online for some time after incoming msg

This commit is contained in:
John Preston
2015-01-23 12:48:21 +03:00
parent 12f6b340e5
commit b688a2e518
4 changed files with 60 additions and 87 deletions

View File

@@ -193,7 +193,10 @@ namespace App {
}
int32 onlineWillChangeIn(int32 online, int32 now) {
if (online <= 0) return 86400;
if (online <= 0) {
if (-online > now) return -online - now;
return 86400;
}
if (online > now) {
return online - now;
}
@@ -217,11 +220,12 @@ namespace App {
if (online <= 0) {
switch (online) {
case 0: return lang(lng_status_offline);
case -1: return lang(lng_status_invisible);
case -2: return lang(lng_status_recently);
case -3: return lang(lng_status_last_week);
case -4: return lang(lng_status_last_month);
}
return lang(lng_status_invisible);
return (-online > now) ? lang(lng_status_online) : lang(lng_status_recently);
}
if (online > now) {
return lang(lng_status_online);