Prechádzať zdrojové kódy

Fix replies from the management room

This was accidentally broken when implementing e2be.
Gary Kramlich 3 rokov pred
rodič
commit
d788565d2b
1 zmenil súbory, kde vykonal 2 pridanie a 9 odobranie
  1. 2 9
      bridge/commands.go

+ 2 - 9
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)
 	}