diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-12-12 08:20:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 08:20:59 +0100 |
commit | 7d2344049d0780e92b071939addc41219ce94f5a (patch) | |
tree | 5c176838ae54ac2d6e8a684da8ff4d981a65863b /roomserver/internal/query | |
parent | aaf4e5c8654463cc5431d57db9163ad9ed558f53 (diff) |
Cleanup stale device lists for users we don't share a room with anymore (#2857)
The stale device lists table might contain entries for users we don't
share a room with anymore. This now asks the roomserver about left users
and removes those entries from the table.
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'roomserver/internal/query')
-rw-r--r-- | roomserver/internal/query/query.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go index d8456fb4..69d841dd 100644 --- a/roomserver/internal/query/query.go +++ b/roomserver/internal/query/query.go @@ -805,6 +805,12 @@ func (r *Queryer) QueryBulkStateContent(ctx context.Context, req *api.QueryBulkS return nil } +func (r *Queryer) QueryLeftUsers(ctx context.Context, req *api.QueryLeftUsersRequest, res *api.QueryLeftUsersResponse) error { + var err error + res.LeftUsers, err = r.DB.GetLeftUsers(ctx, req.StaleDeviceListUsers) + return err +} + func (r *Queryer) QuerySharedUsers(ctx context.Context, req *api.QuerySharedUsersRequest, res *api.QuerySharedUsersResponse) error { roomIDs, err := r.DB.GetRoomsByMembership(ctx, req.UserID, "join") if err != nil { |