This is an automated email from the ASF dual-hosted git repository.

conradsp pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new f63a8de  Fix bug in generating notification.
     new cd5b380  Merge pull request #511 from Anh3h/notification
f63a8de is described below

commit f63a8dea81f189cc767261c7577012f36e69476e
Author: Anh3h <[email protected]>
AuthorDate: Mon Jan 21 12:21:24 2019 -0500

    Fix bug in generating notification.
    
    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.
---
 .../notification/service/NotificationDomainServiceImpl.java         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
index f6c8e4c..c8981a6 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
@@ -51,7 +51,9 @@ import javax.jms.Queue;
 
 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
@@ -583,7 +585,7 @@ public class NotificationDomainServiceImpl implements 
NotificationDomainService
        
        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= "";
@@ -596,7 +598,7 @@ public class NotificationDomainServiceImpl implements 
NotificationDomainService
                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));
                        }
                }
                

Reply via email to