1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-29 16:34:35 +02:00

feat(reaction): ロールでリアクションの制御をできるように (MisskeyIO#660)

This commit is contained in:
まっちゃてぃー。
2024-07-13 02:08:56 +09:00
committed by GitHub
parent 5ab83ff9d8
commit bb913ee00a
8 changed files with 40 additions and 7 deletions

View File

@@ -116,10 +116,10 @@ export class ReactionService {
if (!await this.noteEntityService.isVisibleForMe(note, user.id)) {
throw new IdentifiableError('68e9d2d1-48bf-42c2-b90a-b20e09fd3d48', 'Note not accessible for you.');
}
const policies = await this.roleService.getUserPolicies(user.id);
let reaction = _reaction ?? FALLBACK;
if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) {
if (note.reactionAcceptance === 'likeOnly' || !policies.canUseReaction || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) {
reaction = '\u2764';
} else if (_reaction) {
const custom = reaction.match(isCustomEmojiRegexp);