2023-06-30 11:05:33 +00:00
|
|
|
package libgm
|
2023-06-30 09:54:08 +00:00
|
|
|
|
|
|
|
import "go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
|
|
|
|
func (c *Client) newMessagesResponse(responseData *Response) (*binary.FetchMessagesResponse, error) {
|
|
|
|
messages := &binary.FetchMessagesResponse{}
|
|
|
|
decryptErr := c.cryptor.DecryptAndDecodeData(responseData.Data.EncryptedData, messages)
|
|
|
|
if decryptErr != nil {
|
|
|
|
return nil, decryptErr
|
|
|
|
}
|
|
|
|
decryptErr = c.decryptImages(messages)
|
|
|
|
if decryptErr != nil {
|
|
|
|
return nil, decryptErr
|
|
|
|
}
|
|
|
|
return messages, nil
|
|
|
|
}
|