Skip to content

Commit c10c81a

Browse files
author
Germain Souquet
committed
Setup sync filter properly
1 parent 2e64bce commit c10c81a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/filter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ export class Filter {
221221
setProp(this.definition, "room.timeline.limit", limit);
222222
}
223223

224+
/**
225+
* Enable threads unread notification
226+
* @param {boolean} enabled
227+
*/
228+
public setUnreadThreadNotifications(enabled: boolean) {
229+
setProp(this.definition, "room.timeline.unread_thread_notifications", enabled);
230+
}
231+
224232
setLazyLoadMembers(enabled: boolean) {
225233
setProp(this.definition, "room.state.lazy_load_members", !!enabled);
226234
}

src/sync.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ interface ISyncParams {
138138
// eslint-disable-next-line camelcase
139139
set_presence?: SetPresence;
140140
_cacheBuster?: string | number; // not part of the API itself
141-
unread_thread_notifications?: boolean;
142-
"org.matrix.msc3773.unread_thread_notifications"?: boolean;
143141
}
144142

145143
type WrappedRoom<T> = T & {
@@ -662,6 +660,7 @@ export class SyncApi {
662660
const buildDefaultFilter = () => {
663661
const filter = new Filter(client.credentials.userId);
664662
filter.setTimelineLimit(this.opts.initialSyncLimit);
663+
filter.setUnreadThreadNotifications(true);
665664
return filter;
666665
};
667666

@@ -1000,8 +999,6 @@ export class SyncApi {
1000999
const qps: ISyncParams = {
10011000
"filter": filterId,
10021001
"timeout": pollTimeout,
1003-
"unread_thread_notifications": true,
1004-
"org.matrix.msc3773.unread_thread_notifications": true,
10051002
};
10061003

10071004
if (this.opts.disablePresence) {

0 commit comments

Comments
 (0)