File tree 1 file changed +9
-0
lines changed
packages/backend/src/core
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,15 @@ export class NoteCreateService implements OnApplicationShutdown {
359
359
mentionedUsers = data . apMentions ?? await this . extractMentionedUsers ( user , combinedTokens ) ;
360
360
}
361
361
362
+ // #region Shrimpia
363
+ if ( user . host != null && mentionedUsers . some ( u => u . host !== null ) ) {
364
+ const userEntity = await this . usersRepository . findOneByOrFail ( { id : user . id } ) ;
365
+ if ( userEntity . followersCount === 0 ) {
366
+ throw new Error ( 'Temporarily, notes including mentions from remote users which no followers are not allowed' ) ;
367
+ }
368
+ }
369
+ // #endregion
370
+
362
371
tags = tags . filter ( tag => Array . from ( tag ) . length <= 128 ) . splice ( 0 , 32 ) ;
363
372
364
373
if ( data . reply && ( user . id !== data . reply . userId ) && ! mentionedUsers . some ( u => u . id === data . reply ! . userId ) ) {
You can’t perform that action at this time.
0 commit comments