From b521bcd81c8501c9bafd13229bc0bd260c5150cf Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 4 May 2018 15:30:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=89=E3=83=A9=E3=82=A4=E3=83=96=E3=81=AE?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E6=83=85=E5=A0=B1=E3=82=92=E9=9D=9E=E6=AD=A3?= =?UTF-8?q?=E8=A6=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/drive-file.ts | 1 + src/services/drive/add-file.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts index 2a7e95363..183cc72ee 100644 --- a/src/models/drive-file.ts +++ b/src/models/drive-file.ts @@ -25,6 +25,7 @@ export const getDriveFileBucket = async (): Promise => { export type IMetadata = { properties: any; userId: mongo.ObjectID; + _user: any; folderId: mongo.ObjectID; comment: string; uri: string; diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index e7f3572c7..50ee11734 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -15,7 +15,7 @@ import DriveFolder from '../../models/drive-folder'; import { pack } from '../../models/drive-file'; import event, { publishDriveStream } from '../../publishers/stream'; import getAcct from '../../acct/render'; -import { IUser, isLocalUser } from '../../models/user'; +import { IUser, isLocalUser, isRemoteUser } from '../../models/user'; import DriveFileThumbnail, { getDriveFileThumbnailBucket, DriveFileThumbnailChunk } from '../../models/drive-file-thumbnail'; import genThumbnail from '../../drive/gen-thumbnail'; @@ -284,6 +284,9 @@ const addFile = async ( const metadata = { userId: user._id, + _user: { + host: user.host + }, folderId: folder !== null ? folder._id : null, comment: comment, properties: properties