From 90ea505dbef7eb913540a4acecab0b45e4ca1651 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 16 Aug 2017 17:19:21 +0100 Subject: [PATCH] Various fixes --- .../dendrite/clientapi/routing/routing.go | 21 ------------------- .../cmd/dendrite-monolith-server/main.go | 2 +- .../storage/public_rooms_table.go | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go index f286b9b65..7317044ce 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go @@ -100,13 +100,6 @@ func Setup( return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], vars["txnID"], &emptyString, cfg, queryAPI, producer) }), ) - r0mux.Handle("/rooms/{roomID}/state/{eventType}/", - common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { - vars := mux.Vars(req) - emptyString := "" - return writers.SendEvent(req, device, vars["roomID"], vars["eventType"], vars["txnID"], &emptyString, cfg, queryAPI, producer) - }), - ) r0mux.Handle("/rooms/{roomID}/state/{eventType}/{stateKey}", common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { vars := mux.Vars(req) @@ -266,20 +259,6 @@ func Setup( }), ) - r0mux.Handle("/publicRooms", - common.MakeAPI("public_rooms", func(req *http.Request) util.JSONResponse { - // TODO: Return a list of public rooms - return util.JSONResponse{ - Code: 200, - JSON: struct { - Chunk []struct{} `json:"chunk"` - Start string `json:"start"` - End string `json:"end"` - }{[]struct{}{}, "", ""}, - } - }), - ) - unstableMux.Handle("/thirdparty/protocols", common.MakeAPI("thirdparty_protocols", func(req *http.Request) util.JSONResponse { // TODO: Return the third party protcols diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go index 25c06dde8..1dbbe1903 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go @@ -300,7 +300,7 @@ func (m *monolith) setupConsumers() { } publicRoomsAPIConsumer := publicroomsapi_consumers.NewOutputRoomEvent( - m.cfg, m.kafkaConsumer, m.publicRoomsAPIDB, + m.cfg, m.kafkaConsumer(), m.publicRoomsAPIDB, ) if err = publicRoomsAPIConsumer.Start(); err != nil { log.Panicf("startup: failed to start room server consumer: %s", err) diff --git a/src/github.com/matrix-org/dendrite/publicroomsapi/storage/public_rooms_table.go b/src/github.com/matrix-org/dendrite/publicroomsapi/storage/public_rooms_table.go index f0632693b..5cef577e7 100644 --- a/src/github.com/matrix-org/dendrite/publicroomsapi/storage/public_rooms_table.go +++ b/src/github.com/matrix-org/dendrite/publicroomsapi/storage/public_rooms_table.go @@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS publicroomsapi_public_rooms( -- Aliases of the room (empty array if none) aliases TEXT[] NOT NULL DEFAULT '{}'::TEXT[], -- Canonical alias of the room (empty string if none) - canonical_alias TEXT, + canonical_alias TEXT NOT NULL DEFAULT '', -- Name of the room (empty string if none) name TEXT NOT NULL DEFAULT '', -- Topic of the room (empty string if none)