Skip to content

Commit

Permalink
Setup sync filter properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Germain Souquet committed Aug 18, 2022
1 parent 2e64bce commit c10c81a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ export class Filter {
setProp(this.definition, "room.timeline.limit", limit);
}

/**
* Enable threads unread notification
* @param {boolean} enabled
*/
public setUnreadThreadNotifications(enabled: boolean) {
setProp(this.definition, "room.timeline.unread_thread_notifications", enabled);

This comment has been minimized.

Copy link
@t3chguy

t3chguy Aug 18, 2022

Member

doesn't this need to be unstable prefixed?

This comment has been minimized.

Copy link
@germain-gg

germain-gg Aug 19, 2022

Contributor

Probably yes. In here we're testing this on a dev server that has not made it to develop in synapse. Trying to validate a product behaviour.

When this code is meant to reach develop we will do all the appropriate work!

}

setLazyLoadMembers(enabled: boolean) {
setProp(this.definition, "room.state.lazy_load_members", !!enabled);
}
Expand Down
5 changes: 1 addition & 4 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ interface ISyncParams {
// eslint-disable-next-line camelcase
set_presence?: SetPresence;
_cacheBuster?: string | number; // not part of the API itself
unread_thread_notifications?: boolean;
"org.matrix.msc3773.unread_thread_notifications"?: boolean;
}

type WrappedRoom<T> = T & {
Expand Down Expand Up @@ -662,6 +660,7 @@ export class SyncApi {
const buildDefaultFilter = () => {
const filter = new Filter(client.credentials.userId);
filter.setTimelineLimit(this.opts.initialSyncLimit);
filter.setUnreadThreadNotifications(true);
return filter;
};

Expand Down Expand Up @@ -1000,8 +999,6 @@ export class SyncApi {
const qps: ISyncParams = {
"filter": filterId,
"timeout": pollTimeout,
"unread_thread_notifications": true,
"org.matrix.msc3773.unread_thread_notifications": true,
};

if (this.opts.disablePresence) {
Expand Down

0 comments on commit c10c81a

Please sign in to comment.