@@ -101,33 +101,24 @@ export class UserFollowingService implements OnModuleInit {
101101 this . queueService . deliver ( followee , content , follower . inbox , false ) ;
102102 }
103103
104- /**
105- * ThinUserでなくともユーザーの情報が最新でない場合はこちらを使うべき
106- */
107104 @bindThis
108- public async followByThinUser (
105+ public async follow (
109106 _follower : ThinUser ,
110107 _followee : ThinUser ,
111- options : Parameters < typeof this . follow > [ 2 ] = { } ,
112- ) {
113- const [ follower , followee ] = await Promise . all ( [
114- this . usersRepository . findOneByOrFail ( { id : _follower . id } ) ,
115- this . usersRepository . findOneByOrFail ( { id : _followee . id } ) ,
116- ] ) as [ MiLocalUser | MiRemoteUser , MiLocalUser | MiRemoteUser ] ;
117-
118- await this . follow ( follower , followee , options ) ;
119- }
120-
121- @bindThis
122- public async follow (
123- follower : MiLocalUser | MiRemoteUser ,
124- followee : MiLocalUser | MiRemoteUser ,
125108 { requestId, silent = false , withReplies } : {
126109 requestId ?: string ,
127110 silent ?: boolean ,
128111 withReplies ?: boolean ,
129112 } = { } ,
130113 ) : Promise < void > {
114+ /**
115+ * 必ず最新のユーザー情報を取得する
116+ */
117+ const [ follower , followee ] = await Promise . all ( [
118+ this . usersRepository . findOneByOrFail ( { id : _follower . id } ) ,
119+ this . usersRepository . findOneByOrFail ( { id : _followee . id } ) ,
120+ ] ) as [ MiLocalUser | MiRemoteUser , MiLocalUser | MiRemoteUser ] ;
121+
131122 if ( this . userEntityService . isRemoteUser ( follower ) && this . userEntityService . isRemoteUser ( followee ) ) {
132123 // What?
133124 throw new Error ( 'Remote user cannot follow remote user.' ) ;
0 commit comments