Fix replies from the management room
This was accidentally broken when implementing e2be.
This commit is contained in:
@@ -3,7 +3,6 @@ package bridge
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kong"
|
"github.com/alecthomas/kong"
|
||||||
|
|
||||||
@@ -34,17 +33,11 @@ func (g *globals) reply(msg string) {
|
|||||||
content.MsgType = event.MsgNotice
|
content.MsgType = event.MsgNotice
|
||||||
intent := g.bot
|
intent := g.bot
|
||||||
|
|
||||||
if g.portal == nil {
|
if g.portal != nil && g.portal.IsPrivateChat() {
|
||||||
g.handler.log.Errorfln("we don't have a portal for this command")
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if g.portal.IsPrivateChat() {
|
|
||||||
intent = g.portal.MainIntent()
|
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 {
|
if err != nil {
|
||||||
g.handler.log.Warnfln("Failed to reply to command from %q: %v", g.user.MXID, err)
|
g.handler.log.Warnfln("Failed to reply to command from %q: %v", g.user.MXID, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user