Skip to content

Commit

Permalink
fix: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Apr 25, 2023
1 parent d6883d5 commit 4ce49e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/@types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export interface IRelationsRequestOpts {
to?: string;
limit?: number;
dir?: Direction;
recurse?: boolean;
recurse?: boolean; // MSC3981 Relations Recursion https://github.com/matrix-org/matrix-spec-proposals/pull/3981
}

export interface IRelationsResponse {
Expand Down
5 changes: 3 additions & 2 deletions src/models/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ServerControlledNamespacedValue } from "../NamespacedValue";
import { logger } from "../logger";
import { ReadReceipt } from "./read-receipt";
import { CachedReceiptStructure, ReceiptType } from "../@types/read_receipts";
import { Feature } from "../feature";
import { Feature, ServerSupport } from "../feature";

export enum ThreadEvent {
New = "Thread.new",
Expand Down Expand Up @@ -459,7 +459,8 @@ export class Thread extends ReadReceipt<EmittedEvents, EventHandlerMap> {

// XXX: Workaround for https://github.com/matrix-org/matrix-spec-proposals/pull/2676/files#r827240084
private async fetchEditsWhereNeeded(...events: MatrixEvent[]): Promise<unknown> {
if (!this.client.canSupport.get(Feature.RelationsRecursion)) {
const recursionSupport = this.client.canSupport.get(Feature.RelationsRecursion) ?? ServerSupport.Unsupported;
if (recursionSupport !== ServerSupport.Unsupported) {
return Promise.all(
events
.filter((e) => e.isEncrypted())
Expand Down

0 comments on commit 4ce49e8

Please sign in to comment.