mirror of
https://github.com/plankanban/planka.git
synced 2025-12-19 17:23:27 +03:00
fix: Improve mentions behavior
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
const escapeMarkdown = require('escape-markdown');
|
||||
const escapeHtml = require('escape-html');
|
||||
|
||||
const { extractMentionIds, formatTextWithMentions } = require('../../../utils/mentions');
|
||||
const { extractMentionIds, mentionMarkupToText } = require('../../../utils/mentions');
|
||||
|
||||
const buildAndSendNotifications = async (services, board, card, comment, actorUser, t) => {
|
||||
const markdownCardLink = `[${escapeMarkdown(card.name)}](${sails.config.custom.baseUrl}/cards/${card.id})`;
|
||||
const htmlCardLink = `<a href="${sails.config.custom.baseUrl}/cards/${card.id}}">${escapeHtml(card.name)}</a>`;
|
||||
const commentText = _.truncate(formatTextWithMentions(comment.text));
|
||||
const commentText = _.truncate(mentionMarkupToText(comment.text));
|
||||
|
||||
await sails.helpers.utils.sendNotifications(services, t('New Comment'), {
|
||||
text: `${t(
|
||||
@@ -101,10 +101,9 @@ module.exports = {
|
||||
if (mentionUserIds.length > 0) {
|
||||
const boardMemberUserIds = await sails.helpers.boards.getMemberUserIds(inputs.board.id);
|
||||
|
||||
mentionUserIds = _.difference(
|
||||
_.intersection(mentionUserIds, boardMemberUserIds),
|
||||
mentionUserIds = _.difference(_.intersection(mentionUserIds, boardMemberUserIds), [
|
||||
comment.userId,
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
const mentionUserIdsSet = new Set(mentionUserIds);
|
||||
|
||||
Reference in New Issue
Block a user