mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-28 15:44:14 +00:00
relax some tests to consider new messages new
This commit is contained in:
parent
bdc65cc243
commit
e5740cc206
@ -15,13 +15,13 @@ var PURGE_OLD_MENTIONS_TIMEOUT = 3600 * 24 * 30; // one month
|
|||||||
function processMention(user, mentionTime, data) {
|
function processMention(user, mentionTime, data) {
|
||||||
var key = user + ";" + mentionTime;
|
var key = user + ";" + mentionTime;
|
||||||
var curTime = new Date().getTime() / 1000;
|
var curTime = new Date().getTime() / 1000;
|
||||||
if( mentionTime > curTime + 3600 ) {
|
if( mentionTime > curTime + 3600 * 2 ) {
|
||||||
console.log("mention from the future will be ignored");
|
console.log("mention from the future will be ignored");
|
||||||
} else {
|
} else {
|
||||||
var newMentionsUpdated = false;
|
var newMentionsUpdated = false;
|
||||||
if( !(key in _knownMentions) ) {
|
if( !(key in _knownMentions) ) {
|
||||||
// mention must be somewhat recent compared to last known one to be considered new
|
// mention must be somewhat recent compared to last known one to be considered new
|
||||||
if( mentionTime + 3600 > _lastMentionTime ) {
|
if( mentionTime + 3600 * 24 * 3 > _lastMentionTime ) {
|
||||||
_newMentions++;
|
_newMentions++;
|
||||||
newMentionsUpdated = true;
|
newMentionsUpdated = true;
|
||||||
_lastMentionTime = mentionTime;
|
_lastMentionTime = mentionTime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user