mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 04:52:46 +00:00
Rename the typing server to EDU server (#948)
* Blunt move and sed rename * Rename common/ refs to typing * Rename internal stuff in eduserver * Rename docs and scripts * Rename constants/filenames, goimports everything to re-order imports
This commit is contained in:
parent
f72b759426
commit
11a8059bba
30 changed files with 153 additions and 153 deletions
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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 {
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue