Roll-forward "Add preliminary support for persisting pre-saved history entries remotely"

This rolls-forward commit 66916c27cb.
This commit is contained in:
David Dworken
2023-09-22 13:13:46 -07:00
parent dc166ec089
commit 2a5a6d65c4
8 changed files with 76 additions and 42 deletions

View File

@ -9,13 +9,14 @@ import (
// Represents an encrypted history entry
type EncHistoryEntry struct {
EncryptedData []byte `json:"enc_data"`
Nonce []byte `json:"nonce"`
DeviceId string `json:"device_id"`
UserId string `json:"user_id"`
Date time.Time `json:"time"`
EncryptedId string `json:"id"`
ReadCount int `json:"read_count"`
EncryptedData []byte `json:"enc_data"`
Nonce []byte `json:"nonce"`
DeviceId string `json:"device_id"`
UserId string `json:"user_id"`
// Note that EncHistoryEntry.Date == HistoryEntry.EndTime
Date time.Time `json:"time"`
EncryptedId string `json:"id"`
ReadCount int `json:"read_count"`
}
/*
@ -87,8 +88,11 @@ type MessageIdentifiers struct {
type MessageIdentifier struct {
// The device that the entry was recorded on (NOT the device where it is stored/requesting deletion)
DeviceId string `json:"device_id"`
// The timestamp when the message finished running
Date time.Time `json:"date"`
// The timestamp when the command finished running. Serialized as "date" for legacy compatibility.
EndTime time.Time `json:"date"`
// The timestamp when the command started running.
// Note this field was added as part of supporting pre-saving commands, so older clients do not set this field
StartTime time.Time `json:"start_time"`
}
func (m *MessageIdentifiers) Scan(value interface{}) error {