You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to get on demand history for a chat. The log shows that the history sync request is being sent. However, the historysync event handler is not receiving any events. Has anyone been able to successfully call BuildHistorySyncRequest? Am I missing something?
Here is a snippet of code that builds and sends the request using SendMessage.
// Parse the chat JID
chatJID, err := types.ParseJID(req.Chat)
if err != nil {
s.Respond(w, r, http.StatusBadRequest, errors.New("Invalid chat JID"))
return
}
// Create message info for the history sync request
msgInfo := &types.MessageInfo{
ID: req.MessageID,
MessageSource: types.MessageSource{
Chat: chatJID,
IsFromMe: req.IsFromMe,
},
Timestamp: time.UnixMilli(req.Timestamp),
}
// Build the history sync request
historyMsg := clientPointer[userid].BuildHistorySyncRequest(msgInfo, req.MessageCount)
// Send the history sync request and wait for the response
_, err = clientPointer[userid].SendMessage(context.Background(), chatJID, historyMsg, whatsmeow.SendRequestExtra{Peer: true})
if err != nil {
s.Respond(w, r, http.StatusInternalServerError, fmt.Errorf("Failed to send history sync request: %v", err))
return
}
response := map[string]interface{}{
"Details": "History sync request sent successfully",
}
The text was updated successfully, but these errors were encountered:
Trying to get on demand history for a chat. The log shows that the history sync request is being sent. However, the historysync event handler is not receiving any events. Has anyone been able to successfully call BuildHistorySyncRequest? Am I missing something?
Here is a snippet of code that builds and sends the request using SendMessage.
The text was updated successfully, but these errors were encountered: