Watch
1
0
Fork
You've already forked mautrix-whatsapp
0
mirror of https://github.com/mautrix/whatsapp.git synced 2026-11-09 15:49:18 -05:00

Compare commits

...
Author SHA1 Message Date
indent[bot]
945474343f
backfill: log stub and message type of unparseable history messages (#1034)
Co-authored-by: Indent <noreply@indent.com>
2026-11-09 18:09:56 +00:00
indent[bot]
5c8c1fc835
handlewhatsapp: ignore HD replacement messages without replacement content (#1037)
Co-authored-by: Indent <noreply@indent.com>
2026-11-09 18:09:28 +00:00
2 changed files with 11 additions and 0 deletions

View file

@ -298,6 +298,9 @@ func (wa *WhatsAppClient) handleWAHistorySync(
Int("msg_index", i).
Str("msg_id", rawMsg.GetMessage().GetKey().GetID()).
Uint64("msg_time_seconds", rawMsg.GetMessage().GetMessageTimestamp()).
Stringer("stub_type", rawMsg.GetMessage().GetMessageStubType()).
Str("message_type", getMessageType(rawMsg.GetMessage().GetMessage())).
Bool("from_me", rawMsg.GetMessage().GetKey().GetFromMe()).
Msg("Dropping historical message due to parse error")
log.Trace().
Any("web_message_info", rawMsg.GetMessage()).

View file

@ -374,6 +374,14 @@ func (wa *WhatsAppClient) handleWAMessage(ctx context.Context, evt *events.Messa
if assocType := messageAssoc.GetAssociationType(); assocType == waE2E.MessageAssociation_HD_IMAGE_DUAL_UPLOAD || assocType == waE2E.MessageAssociation_HD_VIDEO_DUAL_UPLOAD {
parentKey := messageAssoc.GetParentMessageKey()
protocolMsg, shouldHideEdit := makeHDMediaReplacementEdit(evt.Message, parentKey)
if protocolMsg.GetEditedMessage() == nil {
wa.UserLogin.Log.Debug().
Str("message_id", evt.Info.ID).
Str("parent_id", parentKey.GetID()).
Stringer("assoc_type", assocType).
Msg("Ignoring HD replacement message without replacement content")
return
}
dontRenderEdited = shouldHideEdit
wa.UserLogin.Log.Debug().
Str("message_id", evt.Info.ID).