MSC4380: Invite blocking (#31268)
* Initial implementation of MSC4380 * fix lint * Update InviteRulesAccountSetting-test * add some docs * `block_all` -> `default_action` * Add a unit test for BlockInvitesConfigController
This commit is contained in:
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
export const INVITE_RULES_ACCOUNT_DATA_TYPE = "org.matrix.msc4155.invite_permission_config";
|
||||
export const MSC4380_INVITE_RULES_ACCOUNT_DATA_TYPE = "org.matrix.msc4380.invite_permission_config";
|
||||
|
||||
export interface InviteConfigAccountData {
|
||||
allowed_users?: string[];
|
||||
|
||||
Vendored
+8
-1
@@ -15,7 +15,11 @@ import type { EmptyObject } from "matrix-js-sdk/src/matrix";
|
||||
import type { DeviceClientInformation } from "../utils/device/types.ts";
|
||||
import type { UserWidget } from "../utils/WidgetUtils-types.ts";
|
||||
import { type MediaPreviewConfig } from "./media_preview.ts";
|
||||
import { type INVITE_RULES_ACCOUNT_DATA_TYPE, type InviteConfigAccountData } from "./invite-rules.ts";
|
||||
import {
|
||||
type INVITE_RULES_ACCOUNT_DATA_TYPE,
|
||||
type InviteConfigAccountData,
|
||||
type MSC4380_INVITE_RULES_ACCOUNT_DATA_TYPE,
|
||||
} from "./invite-rules.ts";
|
||||
|
||||
// Extend Matrix JS SDK types via Typescript declaration merging to support unspecced event fields and types
|
||||
declare module "matrix-js-sdk/src/types" {
|
||||
@@ -91,6 +95,9 @@ declare module "matrix-js-sdk/src/types" {
|
||||
|
||||
// MSC4155: Invite filtering
|
||||
[INVITE_RULES_ACCOUNT_DATA_TYPE]: InviteConfigAccountData;
|
||||
|
||||
[MSC4380_INVITE_RULES_ACCOUNT_DATA_TYPE]: { default_action?: "allow" | "block" };
|
||||
|
||||
"io.element.msc4278.media_preview_config": MediaPreviewConfig;
|
||||
|
||||
// Indicate whether recovery is enabled or disabled
|
||||
|
||||
Reference in New Issue
Block a user