@@ -36,7 +36,11 @@ import { StubStore } from "./store/stub";
3636import { CallEvent , CallEventHandlerMap , createNewMatrixCall , MatrixCall , supportsMatrixCall } from "./webrtc/call" ;
3737import { Filter , IFilterDefinition , IRoomEventFilter } from "./filter" ;
3838import { CallEventHandlerEvent , CallEventHandler , CallEventHandlerEventHandlerMap } from "./webrtc/callEventHandler" ;
39- import { GroupCallEventHandlerEvent , GroupCallEventHandlerEventHandlerMap } from "./webrtc/groupCallEventHandler" ;
39+ import {
40+ GroupCallEventHandler ,
41+ GroupCallEventHandlerEvent ,
42+ GroupCallEventHandlerEventHandlerMap ,
43+ } from "./webrtc/groupCallEventHandler" ;
4044import * as utils from "./utils" ;
4145import { replaceParam , QueryDict , sleep , noUnsafeEventProps , safeSet } from "./utils" ;
4246import { Direction , EventTimeline } from "./models/event-timeline" ;
@@ -180,7 +184,6 @@ import { IThreepid } from "./@types/threepids";
180184import { CryptoStore , OutgoingRoomKeyRequest } from "./crypto/store/base" ;
181185import { GroupCall , IGroupCallDataChannelOptions , GroupCallIntent , GroupCallType } from "./webrtc/groupCall" ;
182186import { MediaHandler } from "./webrtc/mediaHandler" ;
183- import { GroupCallEventHandler } from "./webrtc/groupCallEventHandler" ;
184187import { LoginTokenPostResponse , ILoginFlowsResponse , IRefreshTokenResponse , SSOAction } from "./@types/auth" ;
185188import { TypedEventEmitter } from "./models/typed-event-emitter" ;
186189import { MAIN_ROOM_TIMELINE , ReceiptType } from "./@types/read_receipts" ;
@@ -4087,27 +4090,23 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
40874090 queryString [ "server_name" ] = opts . viaServers ;
40884091 }
40894092
4090- try {
4091- const data : IJoinRequestBody = { } ;
4092- const signedInviteObj = await signPromise ;
4093- if ( signedInviteObj ) {
4094- data . third_party_signed = signedInviteObj ;
4095- }
4093+ const data : IJoinRequestBody = { } ;
4094+ const signedInviteObj = await signPromise ;
4095+ if ( signedInviteObj ) {
4096+ data . third_party_signed = signedInviteObj ;
4097+ }
40964098
4097- const path = utils . encodeUri ( "/join/$roomid" , { $roomid : roomIdOrAlias } ) ;
4098- const res = await this . http . authedRequest < { room_id : string } > ( Method . Post , path , queryString , data ) ;
4099+ const path = utils . encodeUri ( "/join/$roomid" , { $roomid : roomIdOrAlias } ) ;
4100+ const res = await this . http . authedRequest < { room_id : string } > ( Method . Post , path , queryString , data ) ;
40994101
4100- const roomId = res . room_id ;
4101- const syncApi = new SyncApi ( this , this . clientOpts , this . buildSyncApiOptions ( ) ) ;
4102- const room = syncApi . createRoom ( roomId ) ;
4103- if ( opts . syncRoom ) {
4104- // v2 will do this for us
4105- // return syncApi.syncRoom(room);
4106- }
4107- return room ;
4108- } catch ( e ) {
4109- throw e ; // rethrow for reject
4102+ const roomId = res . room_id ;
4103+ const syncApi = new SyncApi ( this , this . clientOpts , this . buildSyncApiOptions ( ) ) ;
4104+ const syncRoom = syncApi . createRoom ( roomId ) ;
4105+ if ( opts . syncRoom ) {
4106+ // v2 will do this for us
4107+ // return syncApi.syncRoom(room);
41104108 }
4109+ return syncRoom ;
41114110 }
41124111
41134112 /**
@@ -4689,7 +4688,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
46894688 const eventType : string = EventType . RoomMessage ;
46904689 const sendContent : IContent = content as IContent ;
46914690
4692- return this . sendEvent ( roomId , threadId as string | null , eventType , sendContent , txnId ) ;
4691+ return this . sendEvent ( roomId , threadId , eventType , sendContent , txnId ) ;
46934692 }
46944693
46954694 /**
@@ -5005,7 +5004,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
50055004 rpEvent ?: MatrixEvent ,
50065005 ) : Promise < { } > {
50075006 const room = this . getRoom ( roomId ) ;
5008- if ( room && room . hasPendingEvent ( rmEventId ) ) {
5007+ if ( room ? .hasPendingEvent ( rmEventId ) ) {
50095008 throw new Error ( `Cannot set read marker to a pending event (${ rmEventId } )` ) ;
50105009 }
50115010
@@ -5058,9 +5057,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
50585057 const key = ts + "_" + url ;
50595058
50605059 // If there's already a request in flight (or we've handled it), return that instead.
5061- const cachedPreview = this . urlPreviewCache [ key ] ;
5062- if ( cachedPreview ) {
5063- return cachedPreview ;
5060+ if ( key in this . urlPreviewCache ) {
5061+ return this . urlPreviewCache [ key ] ;
50645062 }
50655063
50665064 const resp = this . http . authedRequest < IPreviewUrlResponse > (
0 commit comments