aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/clientapi.go8
-rw-r--r--clientapi/producers/eduserver.go (renamed from clientapi/producers/typingserver.go)18
-rw-r--r--clientapi/routing/routing.go4
-rw-r--r--clientapi/routing/sendtyping.go6
4 files changed, 18 insertions, 18 deletions
diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go
index e608b69f..1339f7c8 100644
--- a/clientapi/clientapi.go
+++ b/clientapi/clientapi.go
@@ -23,9 +23,9 @@ import (
"github.com/matrix-org/dendrite/clientapi/routing"
"github.com/matrix-org/dendrite/common/basecomponent"
"github.com/matrix-org/dendrite/common/transactions"
+ eduServerAPI "github.com/matrix-org/dendrite/eduserver/api"
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
- typingServerAPI "github.com/matrix-org/dendrite/typingserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
)
@@ -41,13 +41,13 @@ func SetupClientAPIComponent(
aliasAPI roomserverAPI.RoomserverAliasAPI,
inputAPI roomserverAPI.RoomserverInputAPI,
queryAPI roomserverAPI.RoomserverQueryAPI,
- typingInputAPI typingServerAPI.TypingServerInputAPI,
+ eduInputAPI eduServerAPI.EDUServerInputAPI,
asAPI appserviceAPI.AppServiceQueryAPI,
transactionsCache *transactions.Cache,
fedSenderAPI federationSenderAPI.FederationSenderQueryAPI,
) {
roomserverProducer := producers.NewRoomserverProducer(inputAPI, queryAPI)
- typingProducer := producers.NewTypingServerProducer(typingInputAPI)
+ eduProducer := producers.NewEDUServerProducer(eduInputAPI)
userUpdateProducer := &producers.UserUpdateProducer{
Producer: base.KafkaProducer,
@@ -69,6 +69,6 @@ func SetupClientAPIComponent(
routing.Setup(
base.APIMux, base.Cfg, roomserverProducer, queryAPI, aliasAPI, asAPI,
accountsDB, deviceDB, federation, *keyRing, userUpdateProducer,
- syncProducer, typingProducer, transactionsCache, fedSenderAPI,
+ syncProducer, eduProducer, transactionsCache, fedSenderAPI,
)
}
diff --git a/clientapi/producers/typingserver.go b/clientapi/producers/eduserver.go
index f4d0bcba..14414ec6 100644
--- a/clientapi/producers/typingserver.go
+++ b/clientapi/producers/eduserver.go
@@ -16,24 +16,24 @@ import (
"context"
"time"
- "github.com/matrix-org/dendrite/typingserver/api"
+ "github.com/matrix-org/dendrite/eduserver/api"
"github.com/matrix-org/gomatrixserverlib"
)
-// TypingServerProducer produces events for the typing server to consume
-type TypingServerProducer struct {
- InputAPI api.TypingServerInputAPI
+// EDUServerProducer produces events for the typing server to consume
+type EDUServerProducer struct {
+ InputAPI api.EDUServerInputAPI
}
-// NewTypingServerProducer creates a new TypingServerProducer
-func NewTypingServerProducer(inputAPI api.TypingServerInputAPI) *TypingServerProducer {
- return &TypingServerProducer{
+// NewEDUServerProducer creates a new EDUServerProducer
+func NewEDUServerProducer(inputAPI api.EDUServerInputAPI) *EDUServerProducer {
+ return &EDUServerProducer{
InputAPI: inputAPI,
}
}
-// Send typing event to typing server
-func (p *TypingServerProducer) Send(
+// SendTyping sends a typing event to EDU server
+func (p *EDUServerProducer) SendTyping(
ctx context.Context, userID, roomID string,
typing bool, timeout int64,
) error {
diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go
index 22ff12b0..91a1588c 100644
--- a/clientapi/routing/routing.go
+++ b/clientapi/routing/routing.go
@@ -58,7 +58,7 @@ func Setup(
keyRing gomatrixserverlib.KeyRing,
userUpdateProducer *producers.UserUpdateProducer,
syncProducer *producers.SyncAPIProducer,
- typingProducer *producers.TypingServerProducer,
+ eduProducer *producers.EDUServerProducer,
transactionsCache *transactions.Cache,
federationSender federationSenderAPI.FederationSenderQueryAPI,
) {
@@ -235,7 +235,7 @@ func Setup(
if err != nil {
return util.ErrorResponse(err)
}
- return SendTyping(req, device, vars["roomID"], vars["userID"], accountDB, typingProducer)
+ return SendTyping(req, device, vars["roomID"], vars["userID"], accountDB, eduProducer)
}),
).Methods(http.MethodPut, http.MethodOptions)
diff --git a/clientapi/routing/sendtyping.go b/clientapi/routing/sendtyping.go
index 29953c32..ffaa0e66 100644
--- a/clientapi/routing/sendtyping.go
+++ b/clientapi/routing/sendtyping.go
@@ -35,7 +35,7 @@ type typingContentJSON struct {
func SendTyping(
req *http.Request, device *authtypes.Device, roomID string,
userID string, accountDB accounts.Database,
- typingProducer *producers.TypingServerProducer,
+ eduProducer *producers.EDUServerProducer,
) util.JSONResponse {
if device.UserID != userID {
return util.JSONResponse{
@@ -69,10 +69,10 @@ func SendTyping(
return *resErr
}
- if err = typingProducer.Send(
+ if err = eduProducer.SendTyping(
req.Context(), userID, roomID, r.Typing, r.Timeout,
); err != nil {
- util.GetLogger(req.Context()).WithError(err).Error("typingProducer.Send failed")
+ util.GetLogger(req.Context()).WithError(err).Error("eduProducer.Send failed")
return jsonerror.InternalServerError()
}