summaryrefslogtreecommitdiff
path: root/src/models/note.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-05 03:51:54 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-05 03:51:54 +0900
commit861302f0fd2c47d78f6b9c78697a649fcf1342c8 (patch)
tree297a327fb3dff61f78251d175733fa48ee8e27e7 /src/models/note.ts
parentアニメーションを自動再生しないオプション (#4131) (diff)
downloadmisskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.tar.gz
misskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.tar.bz2
misskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.zip
アニメーション画像を無効にする際、サーバーサイドではなくクライアントサイドでURLを変更するように
Diffstat (limited to 'src/models/note.ts')
-rw-r--r--src/models/note.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/models/note.ts b/src/models/note.ts
index b1031d3e9b..352de4f8d6 100644
--- a/src/models/note.ts
+++ b/src/models/note.ts
@@ -11,7 +11,6 @@ import Reaction from './note-reaction';
import { packMany as packFileMany, IDriveFile } from './drive-file';
import Following from './following';
import Emoji from './emoji';
-import wrapUrl from '../misc/wrap-url';
const Note = db.get<INote>('notes');
Note.createIndex('uri', { sparse: true, unique: true });
@@ -248,14 +247,11 @@ export const pack = async (
fields: { _id: false }
});
} else {
- _note.emojis = (await Emoji.find({
+ _note.emojis = Emoji.find({
name: { $in: _note.emojis },
host: host
}, {
fields: { _id: false }
- })).map(emoji => async () => {
- emoji.url = await wrapUrl(emoji.url, me);
- return emoji;
});
}
}
@@ -278,7 +274,7 @@ export const pack = async (
if (_note.geo) delete _note.geo.type;
// Populate user
- _note.user = packUser(_note.userId, me);
+ _note.user = packUser(_note.userId, meId);
// Populate app
if (_note.appId) {
@@ -286,7 +282,7 @@ export const pack = async (
}
// Populate files
- _note.files = packFileMany(_note.fileIds || [], { me });
+ _note.files = packFileMany(_note.fileIds || []);
// Some counts
_note.renoteCount = _note.renoteCount || 0;