forked from MirrorHub/mautrix-whatsapp
Don't drop messages even if database says authenticated user is not in chat
This commit is contained in:
parent
3caca1b9a0
commit
14f039f5a4
1 changed files with 9 additions and 4 deletions
|
@ -1223,12 +1223,17 @@ func (portal *Portal) HandleMatrixMessage(sender *User, evt *mautrix.Event) {
|
|||
relaybotFormatted := false
|
||||
if sender.NeedsRelaybot(portal) {
|
||||
if !portal.HasRelaybot() {
|
||||
if user.HasSession() {
|
||||
portal.log.Debugln("Database says", sender.MXID, "not in chat and no relaybot, but trying to send anyway")
|
||||
} else {
|
||||
portal.log.Debugln("Ignoring message from", sender.MXID, "in chat with no relaybot")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
relaybotFormatted = portal.addRelaybotFormat(sender, evt)
|
||||
sender = portal.bridge.Relaybot
|
||||
}
|
||||
}
|
||||
var err error
|
||||
switch evt.Content.MsgType {
|
||||
case mautrix.MsgText, mautrix.MsgEmote:
|
||||
|
|
Loading…
Reference in a new issue