Update check to only trigger if message is older than 6 hours

This commit is contained in:
Mashintime 2023-07-30 00:38:49 -04:00
parent 129a6bd612
commit 7d61873bf2

View file

@ -1072,9 +1072,12 @@ update_chat = function (obj) {
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) {
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%:",
);
console.log(obj);
@ -1084,7 +1087,7 @@ update_chat = function (obj) {
});
obj.status = "transmitted";
}
}
if (typeof obj.new == "undefined") {
obj.new = 0;
}