fix(backend): リプライ禁止ポリシーにて自分にリプライできないのを修正 (MisskeyIO#495)

This commit is contained in:
kabo2468 2024-03-02 04:28:45 +09:00 committed by GitHub
parent f4348af944
commit 62e7961aea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

@ -383,7 +383,7 @@ export class NoteCreateService implements OnApplicationShutdown {
if (policies.canInitiateConversation === false) { if (policies.canInitiateConversation === false) {
if ( if (
mentionedUsers.some(u => u.id !== user.id) mentionedUsers.some(u => u.id !== user.id)
|| (data.reply && data.reply.replyUserId !== user.id) || (data.reply && data.reply.userId !== user.id)
|| (data.visibility === 'specified' && data.visibleUsers?.some(u => u.id !== user.id)) || (data.visibility === 'specified' && data.visibleUsers?.some(u => u.id !== user.id))
|| (this.isQuote(data) && data.renote.userId !== user.id) || (this.isQuote(data) && data.renote.userId !== user.id)
) { ) {

View File

@ -140,6 +140,10 @@ export const packedRolePoliciesSchema = {
type: 'boolean', type: 'boolean',
optional: false, nullable: false, optional: false, nullable: false,
}, },
canInitiateConversation: {
type: 'boolean',
optional: false, nullable: false,
},
canCreateContent: { canCreateContent: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false, optional: false, nullable: false,

View File

@ -4784,6 +4784,7 @@ export type components = {
gtlAvailable: boolean; gtlAvailable: boolean;
ltlAvailable: boolean; ltlAvailable: boolean;
canPublicNote: boolean; canPublicNote: boolean;
canInitiateConversation: boolean;
canCreateContent: boolean; canCreateContent: boolean;
canUpdateContent: boolean; canUpdateContent: boolean;
canDeleteContent: boolean; canDeleteContent: boolean;