mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Update check to only trigger if message is older than 6 hours
This commit is contained in:
parent
129a6bd612
commit
7d61873bf2
1 changed files with 6 additions and 3 deletions
|
@ -1072,9 +1072,12 @@ update_chat = function (obj) {
|
||||||
obj.status = "failed";
|
obj.status = "failed";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if transmitting and @ 100%
|
// check if in transmitting status and @ 100%
|
||||||
if (obj.status == "transmitting" && obj.type == "transmit" && obj.percent == 100) {
|
if (obj.status == "transmitting" && obj.type == "transmit" && obj.percent == 100) {
|
||||||
console.log(
|
var TimeDifference = new Date().getTime() / 1000 - obj.timestamp;
|
||||||
|
if (TimeDifference > 21600) {
|
||||||
|
//Six hours
|
||||||
|
console.log(
|
||||||
"Resetting message to transmitted since in transmit state and at 100%:",
|
"Resetting message to transmitted since in transmit state and at 100%:",
|
||||||
);
|
);
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
|
@ -1084,7 +1087,7 @@ update_chat = function (obj) {
|
||||||
});
|
});
|
||||||
obj.status = "transmitted";
|
obj.status = "transmitted";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (typeof obj.new == "undefined") {
|
if (typeof obj.new == "undefined") {
|
||||||
obj.new = 0;
|
obj.new = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue