summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-09-22 10:21:20 +0300
committerLauri Ojansivu <x@xet7.org>2018-09-22 10:21:20 +0300
commitf6db23b4697dba0618e92ba9fd9e570be6d08e41 (patch)
tree026fcbdb03f069e4768a8075a7d90feffd992245 /models/cards.js
parent86e3df0e5f977d8b6d3d6f2ac1d4c11b6942b83a (diff)
parentdba5de18828313711b245792d5c6da81fd60031e (diff)
downloadwekan-f6db23b4697dba0618e92ba9fd9e570be6d08e41.tar.gz
wekan-f6db23b4697dba0618e92ba9fd9e570be6d08e41.tar.bz2
wekan-f6db23b4697dba0618e92ba9fd9e570be6d08e41.zip
Merge branch 'feature-rules' of https://github.com/Angtrim/wekan into Angtrim-feature-rules
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/cards.js b/models/cards.js
index 346b4bdd..66bfbcf3 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1165,10 +1165,11 @@ function cardMembers(userId, doc, fieldNames, modifier) {
// Say hello to the new member
if (modifier.$addToSet && modifier.$addToSet.members) {
memberId = modifier.$addToSet.members;
+ const username = Users.findOne(memberId).username;
if (!_.contains(doc.members, memberId)) {
Activities.insert({
userId,
- memberId,
+ username,
activityType: 'joinMember',
boardId: doc.boardId,
cardId: doc._id,
@@ -1179,11 +1180,12 @@ function cardMembers(userId, doc, fieldNames, modifier) {
// Say goodbye to the former member
if (modifier.$pull && modifier.$pull.members) {
memberId = modifier.$pull.members;
+ const username = Users.findOne(memberId).username;
// Check that the former member is member of the card
if (_.contains(doc.members, memberId)) {
Activities.insert({
userId,
- memberId,
+ username,
activityType: 'unjoinMember',
boardId: doc.boardId,
cardId: doc._id,