diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-30 00:34:19 +0100 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-30 00:34:19 +0100 |
| commit | e8e4bafa6410fce77ec70efceec842926c666cfa (patch) | |
| tree | 9eb2be358027169538516ab2adaf4b112b895888 /packages/backend/src/server/api/mastodon/MastodonApiServerService.ts | |
| parent | upd: remove Bearer from auth when looking up token (diff) | |
| download | sharkey-e8e4bafa6410fce77ec70efceec842926c666cfa.tar.gz sharkey-e8e4bafa6410fce77ec70efceec842926c666cfa.tar.bz2 sharkey-e8e4bafa6410fce77ec70efceec842926c666cfa.zip | |
upd: remove host lookup on file updating
Diffstat (limited to 'packages/backend/src/server/api/mastodon/MastodonApiServerService.ts')
| -rw-r--r-- | packages/backend/src/server/api/mastodon/MastodonApiServerService.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index a956cf9036..06aaebf032 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -261,9 +261,8 @@ export class MastodonApiServerService { console.error(tokeninfo); if (tokeninfo && (_request.files as any)['avatar']) { const file = toSingleLast((_request.files as any)['avatar']); - const user = await this.usersRepository.findOneBy({ id: tokeninfo.userId }); const upload = await this.driveService.addFile({ - user: { id: tokeninfo.userId, host: user ? user.host : null }, + user: { id: tokeninfo.userId, host: null }, path: file.path, name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined, sensitive: false, @@ -274,9 +273,8 @@ export class MastodonApiServerService { } if (tokeninfo && (_request.files as any)['header']) { const file = toSingleLast((_request.files as any)['header']); - const user = await this.usersRepository.findOneBy({ id: tokeninfo.userId }); const upload = await this.driveService.addFile({ - user: { id: tokeninfo.userId, host: user ? user.host : null }, + user: { id: tokeninfo.userId, host: null }, path: file.path, name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined, sensitive: false, |