Skip to content
Merged
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
20 changes: 0 additions & 20 deletions packages/federation-sdk/src/services/staging-area.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ export class StagingAreaService {
throw new MissingEventsError('Added missing events');
}

if ('from' in event && event.from !== 'join') {
await this.processAuthorizationStage(event);
}
await this.stateService.handlePdu(await toEventBase(event.event));
await this.processNotificationStage(event);

Expand Down Expand Up @@ -248,23 +245,6 @@ export class StagingAreaService {
return addedMissing;
}

private async processAuthorizationStage(event: EventStagingStore) {
this.logger.debug(`Authorizing event ${event._id}`);
const authEvents = await this.eventService.getAuthEventIds(
event.event.type,
{ roomId: event.event.room_id, senderId: event.event.sender },
);

const isAuthorized = await this.eventAuthService.authorizeEvent(
event.event,
authEvents.map((e) => e.event),
);

if (!isAuthorized) {
throw new Error('event authorization failed');
}
}

private async processNotificationStage(event: EventStagingStore) {
this.logger.debug(`Notifying clients about event ${event._id}`);

Expand Down