gmessages/libgm/response.go
2023-06-30 14:05:33 +03:00

16 lines
470 B
Go

package libgm
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
}