mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Only create NewJoinResponse if we don't already have one
This commit is contained in:
parent
d892a88dbe
commit
dd3d53bcad
|
|
@ -91,9 +91,9 @@ func (p *AccountDataStreamProvider) IncrementalSync(
|
|||
}
|
||||
} else {
|
||||
if roomData, ok := dataRes.RoomAccountData[roomID][dataType]; ok {
|
||||
joinData := *types.NewJoinResponse()
|
||||
if existing, ok := req.Response.Rooms.Join[roomID]; ok {
|
||||
joinData = existing
|
||||
joinData, ok := req.Response.Rooms.Join[roomID]
|
||||
if !ok {
|
||||
joinData = *types.NewJoinResponse()
|
||||
}
|
||||
joinData.AccountData.Events = append(
|
||||
joinData.AccountData.Events,
|
||||
|
|
|
|||
|
|
@ -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…
Reference in a new issue