Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/@types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { type LocalNotificationSettings } from "./local_notifications.ts";
import { type IPushRules } from "./PushRules.ts";
import { type SecretInfo, type SecretStorageKeyDescription } from "../secret-storage.ts";
import { type POLICIES_ACCOUNT_EVENT_TYPE } from "../models/invites-ignorer-types.ts";
import { type InviteConfigAccountData } from "./inviteconfig.ts";

export enum EventType {
// Room state events
Expand Down Expand Up @@ -386,6 +387,8 @@ export interface AccountDataEvents extends SecretStorageAccountDataEvents {
// Invites-ignorer events
[POLICIES_ACCOUNT_EVENT_TYPE.name]: { [key: string]: any };
[POLICIES_ACCOUNT_EVENT_TYPE.altName]: { [key: string]: any };
// MSC4155: Invite filtering
"org.matrix.msc4155.invite_permission_config": InviteConfigAccountData;
}

/**
Expand Down
16 changes: 16 additions & 0 deletions src/@types/inviteconfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type Rule = "allow" | "block";

export interface InviteConfigAccountData {
/**
* Rule exceptions for users. Takes priority over `default` and `server_exceptions`.
*/
user_exceptions: Record<string, Rule>;
/**
* Rule exceptions for users. Takes priority over `default`.
*/
server_exceptions: Record<string, Rule>;
/**
* The default rule for invite handling when no exceptions match.
*/
default: Rule;
}
Loading