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:
kegsay 2023-04-19 15:50:33 +01:00 committed by GitHub
parent 9fa39263c0
commit 72285b2659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
306 changed files with 2117 additions and 1934 deletions

View file

@ -28,6 +28,7 @@ import (
"github.com/matrix-org/dendrite/setup/process"
syncTypes "github.com/matrix-org/dendrite/syncapi/types"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/spec"
"github.com/nats-io/nats.go"
log "github.com/sirupsen/logrus"
)
@ -39,7 +40,7 @@ type OutputReceiptConsumer struct {
durable string
db storage.Database
queues *queue.OutgoingQueues
isLocalServerName func(gomatrixserverlib.ServerName) bool
isLocalServerName func(spec.ServerName) bool
topic string
}
@ -107,7 +108,7 @@ func (t *OutputReceiptConsumer) onMessage(ctx context.Context, msgs []*nats.Msg)
return true
}
receipt.Timestamp = gomatrixserverlib.Timestamp(timestamp)
receipt.Timestamp = spec.Timestamp(timestamp)
joined, err := t.db.GetJoinedHosts(ctx, receipt.RoomID)
if err != nil {
@ -115,7 +116,7 @@ func (t *OutputReceiptConsumer) onMessage(ctx context.Context, msgs []*nats.Msg)
return false
}
names := make([]gomatrixserverlib.ServerName, len(joined))
names := make([]spec.ServerName, len(joined))
for i := range joined {
names[i] = joined[i].ServerName
}
@ -133,7 +134,7 @@ func (t *OutputReceiptConsumer) onMessage(ctx context.Context, msgs []*nats.Msg)
}
edu := &gomatrixserverlib.EDU{
Type: gomatrixserverlib.MReceipt,
Type: spec.MReceipt,
Origin: string(receiptServerName),
}
if edu.Content, err = json.Marshal(content); err != nil {