|
@@ -19,20 +19,13 @@ Notifications = {
|
|
delete notifyServices[serviceName];
|
|
delete notifyServices[serviceName];
|
|
},
|
|
},
|
|
|
|
|
|
- // filter recipients according to user settings for notification
|
|
|
|
- getUsers: (participants, watchers) => {
|
|
|
|
- const userMap = {};
|
|
|
|
- participants.forEach((userId) => {
|
|
|
|
- if (userMap[userId]) return;
|
|
|
|
- const user = Users.findOne(userId);
|
|
|
|
- userMap[userId] = user;
|
|
|
|
- });
|
|
|
|
|
|
+ getUsers: (watchers) => {
|
|
|
|
+ const users = [];
|
|
watchers.forEach((userId) => {
|
|
watchers.forEach((userId) => {
|
|
- if (userMap[userId]) return;
|
|
|
|
const user = Users.findOne(userId);
|
|
const user = Users.findOne(userId);
|
|
- userMap[userId] = user;
|
|
|
|
|
|
+ if (user) users.push(user);
|
|
});
|
|
});
|
|
- return _.map(userMap, (v) => v);
|
|
|
|
|
|
+ return users;
|
|
},
|
|
},
|
|
|
|
|
|
notify: (user, title, description, params) => {
|
|
notify: (user, title, description, params) => {
|