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,8 +1072,11 @@ 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) {
var TimeDifference = new Date().getTime() / 1000 - obj.timestamp;
if (TimeDifference > 21600) {
//Six hours
console.log( console.log(
"Resetting message to transmitted since in transmit state and at 100%:", "Resetting message to transmitted since in transmit state and at 100%:",
); );
@ -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;
} }