mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
refactor: update GMSL (#3058)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
This commit is contained in:
parent
9fa39263c0
commit
72285b2659
306 changed files with 2117 additions and 1934 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal/pushrules"
|
||||
|
@ -139,9 +140,9 @@ func TestMessageStats(t *testing.T) {
|
|||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
ourServer gomatrixserverlib.ServerName
|
||||
ourServer spec.ServerName
|
||||
lastUpdate time.Time
|
||||
initRoomCounts map[gomatrixserverlib.ServerName]map[string]bool
|
||||
initRoomCounts map[spec.ServerName]map[string]bool
|
||||
wantStats userAPITypes.MessageStats
|
||||
}{
|
||||
{
|
||||
|
@ -197,7 +198,7 @@ func TestMessageStats(t *testing.T) {
|
|||
name: "day change creates a new room map",
|
||||
ourServer: "localhost",
|
||||
lastUpdate: time.Now().Add(-time.Hour * 24),
|
||||
initRoomCounts: map[gomatrixserverlib.ServerName]map[string]bool{
|
||||
initRoomCounts: map[spec.ServerName]map[string]bool{
|
||||
"localhost": {"encryptedRoom": true},
|
||||
},
|
||||
args: args{
|
||||
|
@ -219,11 +220,11 @@ func TestMessageStats(t *testing.T) {
|
|||
tt.lastUpdate = time.Now()
|
||||
}
|
||||
if tt.initRoomCounts == nil {
|
||||
tt.initRoomCounts = map[gomatrixserverlib.ServerName]map[string]bool{}
|
||||
tt.initRoomCounts = map[spec.ServerName]map[string]bool{}
|
||||
}
|
||||
s := &OutputRoomEventConsumer{
|
||||
db: db,
|
||||
msgCounts: map[gomatrixserverlib.ServerName]userAPITypes.MessageStats{},
|
||||
msgCounts: map[spec.ServerName]userAPITypes.MessageStats{},
|
||||
roomCounts: tt.initRoomCounts,
|
||||
countsLock: sync.Mutex{},
|
||||
lastUpdate: tt.lastUpdate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue