@@ -189,7 +189,14 @@ import { TypedEventEmitter } from "./models/typed-event-emitter";
189189import { ReceiptType } from "./@types/read_receipts" ;
190190import { MSC3575SlidingSyncRequest , MSC3575SlidingSyncResponse , SlidingSync } from "./sliding-sync" ;
191191import { SlidingSyncSdk } from "./sliding-sync-sdk" ;
192- import { FeatureSupport , Thread , THREAD_RELATION_TYPE , determineFeatureSupport } from "./models/thread" ;
192+ import {
193+ FeatureSupport ,
194+ Thread ,
195+ THREAD_RELATION_TYPE ,
196+ determineFeatureSupport ,
197+ ThreadFilterType ,
198+ threadFilterTypeToFilter
199+ } from "./models/thread" ;
193200import { MBeaconInfoEventContent , M_BEACON_INFO } from "./@types/beacon" ;
194201import { UnstableValue } from "./NamespacedValue" ;
195202import { ToDeviceMessageQueue } from "./ToDeviceMessageQueue" ;
@@ -5408,12 +5415,13 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
54085415 }
54095416
54105417 let event ;
5411- if ( timelineSet . isThreadTimeline ) {
5418+ if ( timelineSet . threadListType ) {
54125419 const res = await this . createThreadListMessagesRequest (
54135420 timelineSet . room . roomId ,
54145421 null ,
54155422 1 ,
54165423 Direction . Backward ,
5424+ timelineSet . threadListType ,
54175425 timelineSet . getFilter ( ) ,
54185426 ) ;
54195427 event = res . chunk ?. [ 0 ] ;
@@ -5517,14 +5525,15 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
55175525 fromToken : string | null ,
55185526 limit = 30 ,
55195527 dir = Direction . Backward ,
5528+ threadListType : ThreadFilterType = ThreadFilterType . All ,
55205529 timelineFilter ?: Filter ,
55215530 ) : Promise < IMessagesResponse > {
55225531 const path = utils . encodeUri ( "/rooms/$roomId/threads" , { $roomId : roomId } ) ;
55235532
55245533 const params : Record < string , string > = {
55255534 limit : limit . toString ( ) ,
55265535 dir : dir ,
5527- include : 'all' ,
5536+ include : threadFilterTypeToFilter ( threadListType ) ,
55285537 } ;
55295538
55305539 if ( fromToken ) {
@@ -5583,7 +5592,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
55835592 public paginateEventTimeline ( eventTimeline : EventTimeline , opts : IPaginateOpts ) : Promise < boolean > {
55845593 const isNotifTimeline = ( eventTimeline . getTimelineSet ( ) === this . notifTimelineSet ) ;
55855594 const room = this . getRoom ( eventTimeline . getRoomId ( ) ) ;
5586- const isThreadListTimeline = eventTimeline . getTimelineSet ( ) . isThreadTimeline ;
5595+ const threadListType = eventTimeline . getTimelineSet ( ) . threadListType ;
55875596 const thread = eventTimeline . getTimelineSet ( ) . thread ;
55885597
55895598 // TODO: we should implement a backoff (as per scrollback()) to deal more
@@ -5655,7 +5664,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
56555664 eventTimeline . paginationRequests [ dir ] = null ;
56565665 } ) ;
56575666 eventTimeline . paginationRequests [ dir ] = promise ;
5658- } else if ( isThreadListTimeline ) {
5667+ } else if ( threadListType ) {
56595668 if ( ! room ) {
56605669 throw new Error ( "Unknown room " + eventTimeline . getRoomId ( ) ) ;
56615670 }
@@ -5669,6 +5678,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
56695678 token ,
56705679 opts . limit ,
56715680 dir ,
5681+ threadListType ,
56725682 eventTimeline . getFilter ( ) ,
56735683 ) . then ( ( res ) => {
56745684 if ( res . state ) {
0 commit comments