File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import QtQuick.Controls 2.0
66import org.kde.plasma.plasmoid 2.0
77import org.kde.plasma.core 2.0 as PlasmaCore
88import org.kde.plasma.components 2.0 as PlasmaComponents
9+ import org.kde.plasma.components 3.0 as PlasmaComponents3
910import org.kde.plasma.extras 2.0 as PlasmaExtras
1011
1112Item {
@@ -81,6 +82,15 @@ Item {
8182 console .log (" NETWORK ONLINE COUNT:" ,onlinecount)
8283 zeroRequest (" network/" + netw+ " /member" , function (res ) {
8384 for (let dat of res) {
85+ // Subtract timestamps to determine how long ago member was seen and convert to seconds
86+ var lastseen = (dat .clock - dat .lastOnline )/ 1000
87+ // console.log("MEMBER LAST SEEN: ", lastseen + " seconds ago" )
88+ // If member has not been seen for more than 120 seconds, consider offline.
89+ if (lastseen < 120 ){
90+ dat .online = true
91+ }else {
92+ dat .online = false
93+ }
8494 if (plasmoid .configuration .show ){
8595 if (! dat .online ){
8696 continue ;}
@@ -245,7 +255,7 @@ Item {
245255 }
246256 }
247257
248- PlasmaExtras . ScrollArea {
258+ PlasmaComponents3 . ScrollView {
249259 anchors .fill : parent
250260
251261 ListView {
You can’t perform that action at this time.
0 commit comments