Skip to content

Commit

Permalink
Fix bug in generating notification.
Browse files Browse the repository at this point in the history
When querying the users required to get a notification, add new topic subscribers
to the current set of subscribers, instead of replacing the currents set of subscribers
with the new topic subscribers.
  • Loading branch information
Anh3h committed Jan 21, 2019
1 parent 4fd584c commit f63a8de
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Map;

@Service
Expand Down Expand Up @@ -583,7 +585,7 @@ private void buildNotification(String permission, String objectType, Long object

private List<Long> retrieveSubscribers(Long officeId, String permission) {

Collection<TopicSubscriberData> topicSubscribers = new ArrayList<>();
Set<TopicSubscriberData> topicSubscribers = new HashSet<>();
List<Long> subscriberIds = new ArrayList<>();
Long entityId = officeId;
String entityType= "";
Expand All @@ -596,7 +598,7 @@ private List<Long> retrieveSubscribers(Long officeId, String permission) {
for (Role curRole : allRoles) {
if (curRole.hasPermissionTo(permission) || curRole.hasPermissionTo("ALL_FUNCTIONS")) {
String memberType = curRole.getName();
topicSubscribers = topicSubscriberReadPlatformService.getSubscribers(entityId, entityType, memberType);
topicSubscribers.addAll(topicSubscriberReadPlatformService.getSubscribers(entityId, entityType, memberType));
}
}

Expand Down

0 comments on commit f63a8de

Please sign in to comment.