mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-27 07:04:24 +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) {
|
||||
var key = user + ";" + mentionTime;
|
||||
var curTime = new Date().getTime() / 1000;
|
||||
if( mentionTime > curTime + 3600 ) {
|
||||
if( mentionTime > curTime + 3600 * 2 ) {
|
||||
console.log("mention from the future will be ignored");
|
||||
} else {
|
||||
var newMentionsUpdated = false;
|
||||
if( !(key in _knownMentions) ) {
|
||||
// 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++;
|
||||
newMentionsUpdated = true;
|
||||
_lastMentionTime = mentionTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user