Remove empty fields from /sync response (#2755)
First attempt at removing empty fields from `/sync` responses. Needs https://github.com/matrix-org/sytest/pull/1298 to keep Sytest happy. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
c85bc3434f
commit
0f777d421c
7 changed files with 178 additions and 90 deletions
|
|
@ -4,10 +4,11 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal/caching"
|
||||
"github.com/matrix-org/dendrite/syncapi/storage"
|
||||
"github.com/matrix-org/dendrite/syncapi/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
type TypingStreamProvider struct {
|
||||
|
|
@ -35,9 +36,9 @@ func (p *TypingStreamProvider) IncrementalSync(
|
|||
continue
|
||||
}
|
||||
|
||||
jr := *types.NewJoinResponse()
|
||||
if existing, ok := req.Response.Rooms.Join[roomID]; ok {
|
||||
jr = existing
|
||||
jr, ok := req.Response.Rooms.Join[roomID]
|
||||
if !ok {
|
||||
jr = types.NewJoinResponse()
|
||||
}
|
||||
|
||||
if users, updated := p.EDUCache.GetTypingUsersIfUpdatedAfter(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue