2021-09-30 00:57:13 +00:00
|
|
|
package model
|
|
|
|
|
2024-02-11 20:14:07 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-09-30 00:57:13 +00:00
|
|
|
// MessageWrapper is the canonical Cwtch overlay wrapper
|
|
|
|
type MessageWrapper struct {
|
|
|
|
Overlay int `json:"o"`
|
|
|
|
Data string `json:"d"`
|
2024-02-11 20:14:07 +00:00
|
|
|
|
|
|
|
// when the data was assembled
|
|
|
|
SendTime time.Time `json:"s,omitempty"`
|
|
|
|
|
|
|
|
// when the data was transmitted (by protocol engine e.g. over Tor)
|
|
|
|
TransitTime time.Time `json:"t,omitempty"`
|
|
|
|
|
|
|
|
// when the data was received
|
|
|
|
RecvTime time.Time `json:"r,omitempty"`
|
2021-09-30 00:57:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OverlayChat is the canonical identifier for chat overlays
|
|
|
|
const OverlayChat = 1
|
|
|
|
|
|
|
|
// OverlayInviteContact is the canonical identifier for the contact invite overlay
|
|
|
|
const OverlayInviteContact = 100
|
|
|
|
|
|
|
|
// OverlayInviteGroup is the canonical identifier for the group invite overlay
|
|
|
|
const OverlayInviteGroup = 101
|
|
|
|
|
|
|
|
// OverlayFileSharing is the canonical identifier for the file sharing overlay
|
|
|
|
const OverlayFileSharing = 200
|