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 {
|
} else {
|
||||||
if roomData, ok := dataRes.RoomAccountData[roomID][dataType]; ok {
|
if roomData, ok := dataRes.RoomAccountData[roomID][dataType]; ok {
|
||||||
joinData := *types.NewJoinResponse()
|
joinData, ok := req.Response.Rooms.Join[roomID]
|
||||||
if existing, ok := req.Response.Rooms.Join[roomID]; ok {
|
if !ok {
|
||||||
joinData = existing
|
joinData = *types.NewJoinResponse()
|
||||||
}
|
}
|
||||||
joinData.AccountData.Events = append(
|
joinData.AccountData.Events = append(
|
||||||
joinData.AccountData.Events,
|
joinData.AccountData.Events,
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/matrix-org/gomatrixserverlib"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal/caching"
|
"github.com/matrix-org/dendrite/internal/caching"
|
||||||
"github.com/matrix-org/dendrite/syncapi/storage"
|
"github.com/matrix-org/dendrite/syncapi/storage"
|
||||||
"github.com/matrix-org/dendrite/syncapi/types"
|
"github.com/matrix-org/dendrite/syncapi/types"
|
||||||
"github.com/matrix-org/gomatrixserverlib"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TypingStreamProvider struct {
|
type TypingStreamProvider struct {
|
||||||
|
|
@ -35,9 +36,9 @@ func (p *TypingStreamProvider) IncrementalSync(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
jr := *types.NewJoinResponse()
|
jr, ok := req.Response.Rooms.Join[roomID]
|
||||||
if existing, ok := req.Response.Rooms.Join[roomID]; ok {
|
if !ok {
|
||||||
jr = existing
|
jr = *types.NewJoinResponse()
|
||||||
}
|
}
|
||||||
|
|
||||||
if users, updated := p.EDUCache.GetTypingUsersIfUpdatedAfter(
|
if users, updated := p.EDUCache.GetTypingUsersIfUpdatedAfter(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue