From 3830946723c7f96bce4917f384567ffb54bb27fc Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 2 Sep 2017 09:59:21 -0400 Subject: [PATCH 1/2] dont send notif for each topic of forked map --- app/services/notification_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index c587e9ed..7eb84338 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -38,6 +38,7 @@ class NotificationService when TOPIC_ADDED_TO_MAP next unless TopicPolicy.new(follow.user, entity).show? && MapPolicy.new(follow.user, event.map).show? next if follow.user.has_map_open(event.map) + next if event.map.source_id # if map is a fork, send notification for that instead when TOPIC_CONNECTED_1, TOPIC_CONNECTED_2 next unless SynapsePolicy.new(follow.user, event).show? next if follow.user.has_map_with_synapse_open(event) From 64f4249f44d69e06abd4df7fbdf3ddeb599386e2 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 2 Sep 2017 14:12:07 -0400 Subject: [PATCH 2/2] add comment --- app/services/notification_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 7eb84338..81467b2c 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -38,6 +38,8 @@ class NotificationService when TOPIC_ADDED_TO_MAP next unless TopicPolicy.new(follow.user, entity).show? && MapPolicy.new(follow.user, event.map).show? next if follow.user.has_map_open(event.map) + # note, the caveat to this fork related code is that no future updates will be sent + # either. only the notifications for the initial fork should be squashed like this next if event.map.source_id # if map is a fork, send notification for that instead when TOPIC_CONNECTED_1, TOPIC_CONNECTED_2 next unless SynapsePolicy.new(follow.user, event).show?