tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
2.29k stars 427 forks source link

Sometime Object Message is Empty #624

Closed azickri closed 4 months ago

azickri commented 4 months ago

Hello, Whatsmeow Team.

Does anyone often experience cases like ours? We get a Listener with Message data that has no contents or is empty. How do we handle this message?

{
  "Info": {
    "Chat": "62...",
    "Sender": "628..",
    "IsFromMe": true,
    "IsGroup": true,
    "BroadcastListOwner": "",
    "ID": "WHPI6A8A3041",
    "ServerID": 0,
    "Type": "text",
    "PushName": "",
    "Timestamp": "2024-07-15T16:06:37Z",
    "Category": "",
    "Multicast": false,
    "MediaType": "",
    "Edit": "",
    "VerifiedName": {
      "Certificate": {
        "details": "CJydqZGntr==",
        "signature": "1aoja6yg/jZGo0hPJTxkEIzy3HufrNd+GAA=="
      },
      "Details": {
        "serial": 111,
        "issuer": "smb:wa",
        "verifiedName": "Jo..."
      }
    },
    "DeviceSentMeta": null
  },
  "Message": {},
  "IsEphemeral": false,
  "IsViewOnce": false,
  "IsViewOnceV2": false,
  "IsDocumentWithCaption": false,
  "IsEdit": false,
  "SourceWebMsg": null,
  "UnavailableRequestID": "",
  "RetryCount": 0,
  "NewsletterMeta": null,
  "RawMessage": {}
}
SoursopID commented 4 months ago

It is looks like a custom message ID.

azickri commented 4 months ago

@JustSoursop So, it doesn't mean anything?

SoursopID commented 4 months ago

There is a possibility that the message sent is actually empty.

azickri commented 4 months ago

Do you mean, like empty text?

SoursopID commented 4 months ago

Just empty or nil. var msg = nil or var msg = proto.Message{}. Printing a debug log might help to see the actual XML proto message before it is parsed into a Go struct.