summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorRomulus Urakagi Tsai <urakagi@gmail.com>2019-08-14 08:42:25 +0000
committerRomulus Urakagi Tsai <urakagi@gmail.com>2019-08-14 08:42:25 +0000
commit3084f242784e9d860789c153dc6456b1aba16d96 (patch)
treea5f4977970178acd92736577268dc8d9065a619c /models
parentefdab37f3faeb125a9b8d31969762932bbbc0c4b (diff)
parent43d14f8b2b25c2b4b536f747a151b92a7bb014f0 (diff)
downloadwekan-3084f242784e9d860789c153dc6456b1aba16d96.tar.gz
wekan-3084f242784e9d860789c153dc6456b1aba16d96.tar.bz2
wekan-3084f242784e9d860789c153dc6456b1aba16d96.zip
Merge branch 'master' of https://github.com/wekan/wekan
Diffstat (limited to 'models')
-rw-r--r--models/activities.js8
-rw-r--r--models/customFields.js3
2 files changed, 8 insertions, 3 deletions
diff --git a/models/activities.js b/models/activities.js
index 168effd0..3ecd5c8c 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -110,7 +110,9 @@ if (Meteor.isServer) {
if (activity.userId) {
// No need send notification to user of activity
// participants = _.union(participants, [activity.userId]);
- params.user = activity.user().getName();
+ const user = activity.user();
+ params.user = user.getName();
+ params.userEmails = user.emails;
params.userId = activity.userId;
}
if (activity.boardId) {
@@ -172,7 +174,7 @@ if (Meteor.isServer) {
const comment = activity.comment();
params.comment = comment.text;
if (board) {
- const atUser = /(?:^|\s+)@(\S+)(?:\s+|$)/g;
+ const atUser = /(?:^|>|\b|\s)@(\S+)(?:\s|$|<|\b)/g;
const comment = params.comment;
if (comment.match(atUser)) {
const commenter = params.user;
@@ -184,6 +186,8 @@ if (Meteor.isServer) {
}
const user = Users.findOne(username) || Users.findOne({ username });
const uid = user && user._id;
+ params.atUsername = username;
+ params.atEmails = user.emails;
if (board.hasMember(uid)) {
title = 'act-atUserComment';
watchers = _.union(watchers, [uid]);
diff --git a/models/customFields.js b/models/customFields.js
index a5eb8906..6b5697c1 100644
--- a/models/customFields.js
+++ b/models/customFields.js
@@ -302,6 +302,7 @@ if (Meteor.isServer) {
) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
+ const board = Boards.findOne({ _id: paramBoardId });
const id = CustomFields.direct.insert({
name: req.body.name,
type: req.body.type,
@@ -309,7 +310,7 @@ if (Meteor.isServer) {
showOnCard: req.body.showOnCard,
automaticallyOnCard: req.body.automaticallyOnCard,
showLabelOnMiniCard: req.body.showLabelOnMiniCard,
- boardIds: { $in: [paramBoardId] },
+ boardIds: [board._id],
});
const customField = CustomFields.findOne({