アニメーションを自動再生しないオプション (#4131)

* Refactor

* settings

* Media Proxy

* Replace API response
This commit is contained in:
MeiMei
2019-02-05 03:01:36 +09:00
committed by syuilo
parent 00b2d89f1a
commit f014b7ae0e
14 changed files with 404 additions and 170 deletions

View File

@ -11,6 +11,7 @@ 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 });
@ -247,11 +248,14 @@ export const pack = async (
fields: { _id: false }
});
} else {
_note.emojis = Emoji.find({
_note.emojis = (await Emoji.find({
name: { $in: _note.emojis },
host: host
}, {
fields: { _id: false }
})).map(emoji => async () => {
emoji.url = await wrapUrl(emoji.url, me);
return emoji;
});
}
}
@ -274,7 +278,7 @@ export const pack = async (
if (_note.geo) delete _note.geo.type;
// Populate user
_note.user = packUser(_note.userId, meId);
_note.user = packUser(_note.userId, me);
// Populate app
if (_note.appId) {
@ -282,7 +286,7 @@ export const pack = async (
}
// Populate files
_note.files = packFileMany(_note.fileIds || []);
_note.files = packFileMany(_note.fileIds || [], { me });
// Some counts
_note.renoteCount = _note.renoteCount || 0;