diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-04-28 16:12:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 15:12:40 +0100 |
commit | 21ee5b36a41f2cb3960f63ef6f19106d36312aae (patch) | |
tree | 6047bef017ef2716eadd59d14deb4d1936415a70 /syncapi/storage/interface.go | |
parent | 8683ff78b1bee6b7c35e7befb9903c794a17510c (diff) |
Limit presence in `/sync` responses (#2394)
* Use filter and limit presence count
* More limiting
* More limiting
* Fix unit test
* Also limit presence by last_active_ts
* Update query, use "from" as the initial lastPos
* Get 1000 presence events, they are filtered later
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'syncapi/storage/interface.go')
-rw-r--r-- | syncapi/storage/interface.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go index 43aaa358..48697859 100644 --- a/syncapi/storage/interface.go +++ b/syncapi/storage/interface.go @@ -159,6 +159,6 @@ type Database interface { type Presence interface { UpdatePresence(ctx context.Context, userID string, presence types.Presence, statusMsg *string, lastActiveTS gomatrixserverlib.Timestamp, fromSync bool) (types.StreamPosition, error) GetPresence(ctx context.Context, userID string) (*types.PresenceInternal, error) - PresenceAfter(ctx context.Context, after types.StreamPosition) (map[string]*types.PresenceInternal, error) + PresenceAfter(ctx context.Context, after types.StreamPosition, filter gomatrixserverlib.EventFilter) (map[string]*types.PresenceInternal, error) MaxStreamPositionForPresence(ctx context.Context) (types.StreamPosition, error) } |