Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions pkg/whatsmeow/service/whatsmeow.go
Original file line number Diff line number Diff line change
Expand Up @@ -1694,11 +1694,16 @@ func (mycli *MyClient) myEventHandler(rawEvt interface{}) {
doWebhook = true
postMap["event"] = "Archive"

dataMap := postMap["data"].(map[string]interface{})
dataMap["JID"] = evt.JID
dataMap["Timestamp"] = evt.Timestamp
dataMap["Action"] = evt.Action
dataMap["FromFullSync"] = evt.FromFullSync
// postMap["data"] still holds the raw *events.Archive here, so the
// direct map type assertion panicked on every Archive event (a fresh
// pairing history sync emits thousands). Build the map explicitly,
// like the other guarded cases do.
dataMap := map[string]interface{}{
"JID": evt.JID,
"Timestamp": evt.Timestamp,
"Action": evt.Action,
"FromFullSync": evt.FromFullSync,
}
postMap["data"] = dataMap

mycli.loggerWrapper.GetLogger(mycli.userID).LogInfo("[%s] Chat archived", mycli.userID)
Expand Down