mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-15 01:43:49 +01:00
checkpoints: send UNSUPPORTED for broadcast list unsupported
This commit is contained in:
parent
cb3a9a381c
commit
ef24e20902
1 changed files with 7 additions and 1 deletions
|
@ -2212,7 +2212,13 @@ func (portal *Portal) HandleMatrixMessage(sender *User, evt *event.Event) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
portal.log.Errorfln("Error sending message: %v", err)
|
portal.log.Errorfln("Error sending message: %v", err)
|
||||||
portal.sendErrorMessage(err.Error(), true)
|
portal.sendErrorMessage(err.Error(), true)
|
||||||
portal.bridge.AS.SendErrorMessageSendCheckpoint(evt, appservice.StepRemote, err, true, 0)
|
status := appservice.StatusPermFailure
|
||||||
|
if errors.Is(err, whatsmeow.ErrBroadcastListUnsupported) {
|
||||||
|
status = appservice.StatusUnsupported
|
||||||
|
}
|
||||||
|
checkpoint := appservice.NewMessageSendCheckpoint(evt, appservice.StepRemote, status, 0)
|
||||||
|
checkpoint.Info = err.Error()
|
||||||
|
go checkpoint.Send(portal.bridge.AS)
|
||||||
} else {
|
} else {
|
||||||
portal.log.Debugfln("Handled Matrix event %s", evt.ID)
|
portal.log.Debugfln("Handled Matrix event %s", evt.ID)
|
||||||
portal.bridge.AS.SendMessageSendCheckpoint(evt, appservice.StepRemote, 0)
|
portal.bridge.AS.SendMessageSendCheckpoint(evt, appservice.StepRemote, 0)
|
||||||
|
|
Loading…
Reference in a new issue