mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
♻️ Use origin_server_ts instead of timestamp in MR /sync responses.
This commit is contained in:
parent
bf0f05b8fe
commit
129fc42c0b
|
|
@ -817,7 +817,7 @@ func (d *DatabaseTransaction) SelectMultiRoomData(ctx context.Context, r *types.
|
||||||
}
|
}
|
||||||
mr[row.UserId][row.Type] = types.MultiRoomData{
|
mr[row.UserId][row.Type] = types.MultiRoomData{
|
||||||
Content: row.Data,
|
Content: row.Data,
|
||||||
Timestamp: row.Timestamp,
|
OriginServerTs: row.Timestamp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mr, nil
|
return mr, nil
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ type MultiRoomContent []byte
|
||||||
|
|
||||||
type MultiRoomData struct {
|
type MultiRoomData struct {
|
||||||
Content MultiRoomContent `json:"content"`
|
Content MultiRoomContent `json:"content"`
|
||||||
Timestamp int64 `json:"timestamp"`
|
OriginServerTs int64 `json:"origin_server_ts"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d MultiRoomContent) MarshalJSON() ([]byte, error) {
|
func (d MultiRoomContent) MarshalJSON() ([]byte, error) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ func TestMarshallMultiRoom(t *testing.T) {
|
||||||
"@3:example.com": map[string]MultiRoomData{
|
"@3:example.com": map[string]MultiRoomData{
|
||||||
"location": {
|
"location": {
|
||||||
Content: MultiRoomContent(`{"foo":"bar"}`),
|
Content: MultiRoomContent(`{"foo":"bar"}`),
|
||||||
Timestamp: 123,
|
OriginServerTs: 123,
|
||||||
}}})
|
}}})
|
||||||
is.NoErr(err)
|
is.NoErr(err)
|
||||||
is.Equal(m, []byte(`{"@3:example.com":{"location":{"content":{"foo":"bar"},"timestamp":123}}}`))
|
is.Equal(m, []byte(`{"@3:example.com":{"location":{"content":{"foo":"bar"},"timestamp":123}}}`))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue