From 1d86a6c1294ffde52d8410cf6211041e0df1eec0 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 30 Aug 2023 17:16:24 +0300 Subject: [PATCH] Handle all parts of message failing to send --- portal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index cfefada..7da3166 100644 --- a/portal.go +++ b/portal.go @@ -665,7 +665,11 @@ func (portal *Portal) sendMessageParts(ctx context.Context, converted *Converted } } } - portal.markHandled(converted, eventIDs[0], mediaParts, true) + if len(eventIDs) > 0 { + portal.markHandled(converted, eventIDs[0], mediaParts, true) + } else { + zerolog.Ctx(ctx).Warn().Msg("All parts of message failed to send") + } return eventIDs }