diff --git a/federationapi/routing/backfill.go b/federationapi/routing/backfill.go index cd486f00c..90f93b565 100644 --- a/federationapi/routing/backfill.go +++ b/federationapi/routing/backfill.go @@ -15,7 +15,7 @@ package routing import ( - "encoding/json" + json "github.com/json-iterator/go" "fmt" "net/http" "strconv" diff --git a/federationapi/routing/events.go b/federationapi/routing/events.go index 6fa28f69d..ecc78161d 100644 --- a/federationapi/routing/events.go +++ b/federationapi/routing/events.go @@ -16,7 +16,7 @@ package routing import ( "context" - "encoding/json" + json "github.com/json-iterator/go" "net/http" "time" diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 7d77b2828..28acbe382 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -16,7 +16,6 @@ package routing import ( "context" - stdjson "encoding/json" "fmt" json "github.com/json-iterator/go" "net/http" @@ -56,7 +55,7 @@ func Send( } var txnEvents struct { - PDUs []stdjson.RawMessage `json:"pdus"` + PDUs []json.RawMessage `json:"pdus"` EDUs []gomatrixserverlib.EDU `json:"edus"` } diff --git a/federationapi/routing/send_test.go b/federationapi/routing/send_test.go index ba653c1e8..0f814ed50 100644 --- a/federationapi/routing/send_test.go +++ b/federationapi/routing/send_test.go @@ -2,7 +2,7 @@ package routing import ( "context" - "encoding/json" + json "github.com/json-iterator/go" "fmt" "reflect" "testing" diff --git a/federationsender/consumers/eduserver.go b/federationsender/consumers/eduserver.go index 87d0bbdb8..85a8481c0 100644 --- a/federationsender/consumers/eduserver.go +++ b/federationsender/consumers/eduserver.go @@ -16,7 +16,6 @@ package consumers import ( "context" - stdjson "encoding/json" "fmt" json "github.com/json-iterator/go" @@ -121,7 +120,7 @@ func (t *OutputEDUConsumer) onSendToDeviceEvent(msg *sarama.ConsumerMessage) err Sender: ote.Sender, Type: ote.Type, MessageID: util.RandomString(32), - Messages: map[string]map[string]stdjson.RawMessage{ + Messages: map[string]map[string]json.RawMessage{ ote.UserID: { ote.DeviceID: ote.Content, }, diff --git a/federationsender/queue/destinationqueue.go b/federationsender/queue/destinationqueue.go index e87f00634..21a298c19 100644 --- a/federationsender/queue/destinationqueue.go +++ b/federationsender/queue/destinationqueue.go @@ -16,7 +16,7 @@ package queue import ( "context" - "encoding/json" + json "github.com/json-iterator/go" "fmt" "sync" "time" diff --git a/syncapi/storage/storage_test.go b/syncapi/storage/storage_test.go index 2869ac5d2..bfaefc4f5 100644 --- a/syncapi/storage/storage_test.go +++ b/syncapi/storage/storage_test.go @@ -3,7 +3,7 @@ package storage_test import ( "context" "crypto/ed25519" - "encoding/json" + json "github.com/json-iterator/go" "fmt" "os" "testing"