Fix bridging error messages in private chats

This commit is contained in:
Tulir Asokan
2019-08-30 21:32:29 +03:00
parent fccf6e981f
commit 5af374e6b0
2 changed files with 21 additions and 11 deletions

View File

@ -190,17 +190,6 @@ func (mx *MatrixHandler) HandleMessage(evt *mautrix.Event) {
}
}
if !user.HasSession() {
mx.log.Debugln("Ignoring message from", user.MXID, "in", evt.RoomID, "as user has no session")
return
} else if !user.IsConnected() {
msg := format.RenderMarkdown(fmt.Sprintf("\u26a0 You are not connected to WhatsApp, so your message was not bridged. " +
"Use `%s reconnect` to reconnect.", mx.bridge.Config.Bridge.CommandPrefix))
msg.MsgType = mautrix.MsgNotice
_, _ = mx.bridge.Bot.SendMessageEvent(roomID, mautrix.EventMessage, msg)
return
}
portal := mx.bridge.GetPortalByMXID(roomID)
if portal != nil {
portal.HandleMatrixMessage(user, evt)