mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-09 19:27:44 +02:00
Fix directs activity (#7991)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -298,13 +298,11 @@ export const chunterOperation: MigrateOperation = {
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'remove-direct-members-messages',
|
||||
state: 'remove-direct-doc-update-messages',
|
||||
func: async (client) => {
|
||||
await client.deleteMany<DocUpdateMessage>(DOMAIN_ACTIVITY, {
|
||||
_class: activity.class.DocUpdateMessage,
|
||||
attachedToClass: chunter.class.DirectMessage,
|
||||
action: 'update',
|
||||
'attributeUpdates.attrKey': 'members'
|
||||
attachedToClass: chunter.class.DirectMessage
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,6 +614,17 @@ export async function createDirect (employeeIds: Array<Ref<Person>>): Promise<Re
|
||||
if (context.hidden) {
|
||||
await client.updateDoc(context._class, context.space, context._id, { hidden: false })
|
||||
}
|
||||
} else {
|
||||
const space = await client.findOne(contact.class.PersonSpace, { person: me }, { projection: { _id: 1 } })
|
||||
if (space == null) return dmId
|
||||
await client.createDoc(notification.class.DocNotifyContext, space._id, {
|
||||
user: myAcc.primarySocialId,
|
||||
objectId: dmId,
|
||||
objectClass: chunter.class.DirectMessage,
|
||||
objectSpace: core.space.Space,
|
||||
hidden: false,
|
||||
isPinned: false
|
||||
})
|
||||
}
|
||||
|
||||
return dmId
|
||||
|
||||
@@ -275,7 +275,7 @@ export async function generateDocUpdateMessages (
|
||||
if (controlRules.length > 0) {
|
||||
for (const r of controlRules) {
|
||||
for (const s of r.skip) {
|
||||
if (matchQuery([tx], s, r.objectClass, hierarchy).length > 0) {
|
||||
if (matchQuery([tx], s, core.class.TxCUD, hierarchy).length > 0) {
|
||||
// Match found, we need to skip
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user