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
13
portal.go
13
portal.go
|
@ -1223,11 +1223,16 @@ func (portal *Portal) HandleMatrixMessage(sender *User, evt *mautrix.Event) {
|
||||||
relaybotFormatted := false
|
relaybotFormatted := false
|
||||||
if sender.NeedsRelaybot(portal) {
|
if sender.NeedsRelaybot(portal) {
|
||||||
if !portal.HasRelaybot() {
|
if !portal.HasRelaybot() {
|
||||||
portal.log.Debugln("Ignoring message from", sender.MXID, "in chat with no relaybot")
|
if user.HasSession() {
|
||||||
return
|
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
|
||||||
}
|
}
|
||||||
relaybotFormatted = portal.addRelaybotFormat(sender, evt)
|
|
||||||
sender = portal.bridge.Relaybot
|
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
switch evt.Content.MsgType {
|
switch evt.Content.MsgType {
|
||||||
|
|
Loading…
Add table
Reference in a new issue