summaryrefslogtreecommitdiffstats
path: root/models/attachments.js
diff options
context:
space:
mode:
authorRomulus Urakagi Tsai <urakagi@gmail.com>2020-05-08 11:50:43 +0800
committerRomulus Urakagi Tsai <urakagi@gmail.com>2020-05-08 11:50:43 +0800
commit012ca39a8dc29517aef191e85325f3e5889daf37 (patch)
tree85dd76549ec8bc9f24d8254245a16e282a384d9e /models/attachments.js
parentc3458855bdb52c976ee6689ad5a0d4e92e96f2e3 (diff)
downloadwekan-012ca39a8dc29517aef191e85325f3e5889daf37.tar.gz
wekan-012ca39a8dc29517aef191e85325f3e5889daf37.tar.bz2
wekan-012ca39a8dc29517aef191e85325f3e5889daf37.zip
Attachment activities merging done
Diffstat (limited to 'models/attachments.js')
-rw-r--r--models/attachments.js21
1 files changed, 5 insertions, 16 deletions
diff --git a/models/attachments.js b/models/attachments.js
index cab3d9e3..d469f702 100644
--- a/models/attachments.js
+++ b/models/attachments.js
@@ -8,8 +8,7 @@ Attachments = new FilesCollection({
allowClientCode: true,
collectionName: 'attachments2',
onAfterUpload: onAttachmentUploaded,
- onBeforeRemove: onAttachmentRemoving,
- onAfterRemove: onAttachmentRemoved
+ onBeforeRemove: onAttachmentRemoving
});
if (Meteor.isServer) {
@@ -41,9 +40,9 @@ function onAttachmentUploaded(fileRef) {
type: 'card',
activityType: 'addAttachment',
attachmentId: fileRef._id,
- // this preserves the name so that notifications can be meaningful after
+ // this preserves the name so that notifications can be meaningful after
// this file is removed
- attachmentName: fileRef.versions.original.name,
+ attachmentName: fileRef.name,
boardId: fileRef.meta.boardId,
cardId: fileRef.meta.cardId,
listId: fileRef.meta.listId,
@@ -73,9 +72,9 @@ function onAttachmentRemoving(cursor) {
type: 'card',
activityType: 'deleteAttachment',
attachmentId: file._id,
- // this preserves the name so that notifications can be meaningful after
+ // this preserves the name so that notifications can be meaningful after
// this file is removed
- attachmentName: file.versions.original.name,
+ attachmentName: file.name,
boardId: meta.boardId,
cardId: meta.cardId,
listId: meta.listId,
@@ -84,14 +83,4 @@ function onAttachmentRemoving(cursor) {
return true;
}
-function onAttachmentRemoved(files) {
- // Don't know why we need to remove the activity
-/* for (let i in files) {
- let doc = files[i];
- Activities.remove({
- attachmentId: doc._id,
- });
- }*/
-}
-
export default Attachments;