From ef24e209026198637145bfc84b401001a737b98f Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 21 Dec 2021 13:40:08 -0700 Subject: [PATCH] checkpoints: send UNSUPPORTED for broadcast list unsupported --- portal.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index f49f46c..1850ffb 100644 --- a/portal.go +++ b/portal.go @@ -2212,7 +2212,13 @@ func (portal *Portal) HandleMatrixMessage(sender *User, evt *event.Event) { if err != nil { portal.log.Errorfln("Error sending message: %v", err) 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 { portal.log.Debugfln("Handled Matrix event %s", evt.ID) portal.bridge.AS.SendMessageSendCheckpoint(evt, appservice.StepRemote, 0)