Fix Misskey同士でフォローできない

This commit is contained in:
mei23 2018-04-22 00:41:07 +09:00
parent 0dde477dc3
commit d4577307d8
2 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,11 @@ export default async (job: kue.Job, done): Promise<void> => {
}
user = await User.findOne({ usernameLower: username, host: host.toLowerCase() }) as IRemoteUser;
// アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する
if (user === null) {
user = await resolvePerson(activity.actor);
}
} else {
user = await User.findOne({
host: { $ne: null },

View File

@ -40,5 +40,10 @@ export default (user: ILocalUser, url: string, object) => new Promise((resolve,
keyId: `acct:${user.username}@${config.host}`
});
// Signature: Signature ... => Signature: ...
let sig = req.getHeader('Signature').toString();
sig = sig.replace(/^Signature /, '');
req.setHeader('Signature', sig);
req.end(JSON.stringify(object));
});