File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,10 @@ export class Appservice extends EventEmitter {
671
671
private async decryptAppserivceEvent ( roomId : string , encrypted : EncryptedRoomEvent ) : ReturnType < Appservice [ "processEvent" ] > {
672
672
const existingClient = this . cryptoClientForRoomId . get ( roomId ) ;
673
673
const decryptFn = async ( client : MatrixClient ) => {
674
+ // Also fetches state in order to decrypt room. We should throw if the client is confused.
675
+ if ( ! await client . crypto . isRoomEncrypted ( roomId ) ) {
676
+ throw new Error ( "Client detected that the room is not encrypted." )
677
+ }
674
678
let event = ( await client . crypto . decryptRoomEvent ( encrypted , roomId ) ) . raw ;
675
679
event = await this . processEvent ( event ) ;
676
680
this . cryptoClientForRoomId . set ( roomId , client ) ;
You can’t perform that action at this time.
0 commit comments