File tree Expand file tree Collapse file tree 1 file changed +14
-20
lines changed
packages/federation-sdk/src/services Expand file tree Collapse file tree 1 file changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -43,27 +43,21 @@ export class FederationValidationService {
4343 }
4444
4545 private async checkRoomAcl ( roomId : RoomID , domain : string ) : Promise < void > {
46- try {
47- const state = await this . stateService . getLatestRoomState ( roomId ) ;
48- const aclEvent = state . get ( 'm.room.server_acl:' ) ;
49- if ( ! aclEvent || ! aclEvent . isServerAclEvent ( ) ) {
50- return ;
51- }
52-
53- const isAllowed = await this . eventAuthorizationService . checkServerAcl (
54- aclEvent ,
55- domain ,
46+ const state = await this . stateService . getLatestRoomState ( roomId ) ;
47+ const aclEvent = state . get ( 'm.room.server_acl:' ) ;
48+ if ( ! aclEvent || ! aclEvent . isServerAclEvent ( ) ) {
49+ return ;
50+ }
51+
52+ const isAllowed = await this . eventAuthorizationService . checkServerAcl (
53+ aclEvent ,
54+ domain ,
55+ ) ;
56+ if ( ! isAllowed ) {
57+ throw new FederationValidationError (
58+ 'POLICY_DENIED' ,
59+ "Action Blocked. The room's access control policy blocks communication with this domain." ,
5660 ) ;
57- if ( ! isAllowed ) {
58- throw new FederationValidationError (
59- 'POLICY_DENIED' ,
60- "Action Blocked. The room's access control policy blocks communication with this domain." ,
61- ) ;
62- }
63- } catch ( error ) {
64- if ( error instanceof FederationValidationError ) {
65- throw error ;
66- }
6761 }
6862 }
6963
You can’t perform that action at this time.
0 commit comments