aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/notification_events.vala3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala
index 3e077dfc..1830bab4 100644
--- a/libdino/src/service/notification_events.vala
+++ b/libdino/src/service/notification_events.vala
@@ -7,6 +7,7 @@ namespace Dino {
public class NotificationEvents : StreamInteractionModule, Object {
public static ModuleIdentity<NotificationEvents> IDENTITY = new ModuleIdentity<NotificationEvents>("notification_events");
+ private const int MESSAGE_NOTIFICATION_MAX_AGE_SECONDS = 15;
public string id { get { return IDENTITY.id; } }
public signal void notify_content_item(ContentItem content_item, Conversation conversation);
@@ -66,6 +67,8 @@ public class NotificationEvents : StreamInteractionModule, Object {
Message message = ((MessageItem) item).message;
if (message.direction == Message.DIRECTION_SENT) return;
+ DateTime? message_time = message.time;
+ if (message_time != null && message_time.compare(new DateTime.now_utc().add_seconds(-MESSAGE_NOTIFICATION_MAX_AGE_SECONDS)) < 0) return;
if (notify == Conversation.NotifySetting.HIGHLIGHT) {
Jid? nick = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account);