2020-07-06 10:54:22 +02:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/ecdsa"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/protocol/protobuf"
|
|
|
|
)
|
|
|
|
|
2022-05-27 12:14:40 +03:00
|
|
|
type CommKeyExMsgType uint8
|
|
|
|
|
|
|
|
const (
|
|
|
|
KeyExMsgNone CommKeyExMsgType = 0
|
|
|
|
KeyExMsgReuse CommKeyExMsgType = 1
|
|
|
|
KeyExMsgRekey CommKeyExMsgType = 2
|
|
|
|
)
|
|
|
|
|
2020-07-06 10:54:22 +02:00
|
|
|
// RawMessage represent a sent or received message, kept for being able
|
|
|
|
// to re-send/propagate
|
|
|
|
type RawMessage struct {
|
2022-05-27 12:14:40 +03:00
|
|
|
ID string
|
|
|
|
LocalChatID string
|
|
|
|
LastSent uint64
|
|
|
|
SendCount int
|
|
|
|
Sent bool
|
|
|
|
ResendAutomatically bool
|
2023-11-08 19:05:33 +01:00
|
|
|
SkipEncryptionLayer bool // don't wrap message into ProtocolMessage
|
2022-05-27 12:14:40 +03:00
|
|
|
SendPushNotification bool
|
|
|
|
MessageType protobuf.ApplicationMetadataMessage_Type
|
|
|
|
Payload []byte
|
|
|
|
Sender *ecdsa.PrivateKey
|
|
|
|
Recipients []*ecdsa.PublicKey
|
|
|
|
SkipGroupMessageWrap bool
|
2023-12-15 16:16:18 +00:00
|
|
|
SkipApplicationWrap bool
|
2022-05-27 12:14:40 +03:00
|
|
|
SendOnPersonalTopic bool
|
|
|
|
CommunityID []byte
|
|
|
|
CommunityKeyExMsgType CommKeyExMsgType
|
2022-11-07 16:01:06 -04:00
|
|
|
Ephemeral bool
|
2023-06-20 17:12:59 +01:00
|
|
|
BeforeDispatch func(*RawMessage) error
|
2023-06-23 12:49:26 +02:00
|
|
|
HashRatchetGroupID []byte
|
2023-05-22 17:38:02 -04:00
|
|
|
PubsubTopic string
|
2020-07-06 10:54:22 +02:00
|
|
|
}
|