From d788565d2b4ef4f2861ca9567830187d38b0865f Mon Sep 17 00:00:00 2001 From: Gary Kramlich Date: Wed, 27 Apr 2022 13:16:11 -0500 Subject: [PATCH] Fix replies from the management room This was accidentally broken when implementing e2be. --- bridge/commands.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bridge/commands.go b/bridge/commands.go index 83363b6..2799e7f 100644 --- a/bridge/commands.go +++ b/bridge/commands.go @@ -3,7 +3,6 @@ package bridge import ( "context" "fmt" - "time" "github.com/alecthomas/kong" @@ -34,17 +33,11 @@ func (g *globals) reply(msg string) { content.MsgType = event.MsgNotice intent := g.bot - if g.portal == nil { - g.handler.log.Errorfln("we don't have a portal for this command") - - return - } - - if g.portal.IsPrivateChat() { + if g.portal != nil && g.portal.IsPrivateChat() { intent = g.portal.MainIntent() } - _, err := g.portal.sendMatrixMessage(intent, event.EventMessage, &content, nil, time.Now().UTC().UnixMilli()) + _, err := intent.SendMessageEvent(g.roomID, event.EventMessage, content) if err != nil { g.handler.log.Warnfln("Failed to reply to command from %q: %v", g.user.MXID, err) }