geo detection

This commit is contained in:
2025-11-06 15:09:15 +09:00
parent 88d9ccd75d
commit 0bbeb0767b
47 changed files with 1355 additions and 93 deletions

View File

@@ -1118,10 +1118,10 @@ export class NotificationService {
const lastMessageTime = new Date(result.rows[0].created_at);
const now = new Date();
const hoursSinceLastMessage = (now.getTime() - lastMessageTime.getTime()) / (1000 * 60 * 60);
const secondsSinceLastMessage = (now.getTime() - lastMessageTime.getTime()) / 1000;
// Считаем активным если последнее сообщение было менее 10 минут назад
return hoursSinceLastMessage < (10 / 60);
// Считаем активным если последнее сообщение было менее 30 секунд назад
return secondsSinceLastMessage < 30;
} catch (error) {
console.error('Error checking user activity:', error);
return false;