Bug fixes and some refactors

This commit is contained in:
syuilo
2018-04-07 06:13:40 +09:00
parent ef30390e76
commit ba1a81dab1
3 changed files with 31 additions and 15 deletions

View File

@ -19,11 +19,11 @@ export default async (user: IUser, post: IPost) => {
if (inReplyToPost !== null) {
const inReplyToUser = await User.findOne({
_id: post.userId,
_id: inReplyToPost.userId,
});
if (inReplyToUser !== null) {
inReplyTo = `${config.url}@${inReplyToUser.username}/${inReplyToPost._id}`;
inReplyTo = inReplyToPost.uri || `${config.url}/@${inReplyToUser.username}/${inReplyToPost._id}`;
}
}
} else {