This commit is contained in:
syuilo
2018-07-30 07:20:27 +09:00
parent 4e6dcd16ac
commit 83d9730d93
33 changed files with 189 additions and 242 deletions

View File

@@ -2,7 +2,7 @@ import User, { isLocalUser, isRemoteUser, pack as packUser, IUser } from '../../
import Following from '../../models/following';
import FollowingLog from '../../models/following-log';
import FollowedLog from '../../models/followed-log';
import event from '../../stream';
import { publishUserStream } from '../../stream';
import notify from '../../notify';
import pack from '../../remote/activitypub/renderer';
import renderFollow from '../../remote/activitypub/renderer/follow';
@@ -61,12 +61,12 @@ export default async function(follower: IUser, followee: IUser) {
// Publish follow event
if (isLocalUser(follower)) {
packUser(followee, follower).then(packed => event(follower._id, 'follow', packed));
packUser(followee, follower).then(packed => publishUserStream(follower._id, 'follow', packed));
}
// Publish followed event
if (isLocalUser(followee)) {
packUser(follower, followee).then(packed => event(followee._id, 'followed', packed)),
packUser(follower, followee).then(packed => publishUserStream(followee._id, 'followed', packed)),
// 通知を作成
notify(followee._id, follower._id, 'follow');