This commit is contained in:
syuilo
2018-09-19 14:18:34 +09:00
parent 195f676500
commit d9f0e158a3
25 changed files with 239 additions and 39 deletions

View File

@ -348,7 +348,8 @@ export const pack = (
me?: string | mongo.ObjectID | IUser,
options?: {
detail?: boolean,
includeSecrets?: boolean
includeSecrets?: boolean,
includeHasUnreadNotes?: boolean
}
) => new Promise<any>(async (resolve, reject) => {
@ -510,6 +511,11 @@ export const pack = (
}
}
if (!opts.includeHasUnreadNotes) {
delete _user.hasUnreadSpecifiedNotes;
delete _user.hasUnreadMentions;
}
// resolve promises in _user object
_user = await rap(_user);