mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Fix mention email notifictions (#5005)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
73fe59fd00
commit
d3e2436ac4
@ -56,10 +56,6 @@ export async function getPersonNotificationTxes (
|
||||
space: Ref<Space>,
|
||||
originTx: TxCUD<Doc>
|
||||
): Promise<Tx[]> {
|
||||
if (reference.attachedTo === senderId) {
|
||||
return []
|
||||
}
|
||||
|
||||
const receiver = (
|
||||
await control.modelDb.findAll(
|
||||
contact.class.PersonAccount,
|
||||
@ -74,6 +70,10 @@ export async function getPersonNotificationTxes (
|
||||
return []
|
||||
}
|
||||
|
||||
if (receiver._id === senderId) {
|
||||
return []
|
||||
}
|
||||
|
||||
const isAvailable = await isSpaceAvailable(receiver, space, control)
|
||||
|
||||
if (!isAvailable) {
|
||||
@ -87,10 +87,6 @@ export async function getPersonNotificationTxes (
|
||||
res.push(collaboratorsTx)
|
||||
}
|
||||
|
||||
if (await isReferenceAlreadyNotified(reference, receiver._id, control)) {
|
||||
return res
|
||||
}
|
||||
|
||||
const doc = (await control.findAll(reference.srcDocClass, { _id: reference.srcDocId }))[0]
|
||||
|
||||
if (doc === undefined) {
|
||||
@ -103,6 +99,11 @@ export async function getPersonNotificationTxes (
|
||||
}
|
||||
|
||||
const notifyResult = await shouldNotifyCommon(control, receiver._id, notification.ids.MentionCommonNotificationType)
|
||||
|
||||
if (await isReferenceAlreadyNotified(reference, receiver._id, control)) {
|
||||
notifyResult.allowed = false
|
||||
}
|
||||
|
||||
const texes = await getCommonNotificationTxes(
|
||||
control,
|
||||
doc,
|
||||
|
Loading…
Reference in New Issue
Block a user