mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
367b7722d1
- distribute ratchet keys at both community and channel levels - use explicit `HashRatchetGroupID` in ecryption layer, instead of inheriting `groupID` from `CommunityID` - populate `HashRatchetGroupID` with `CommunityID+ChannelID` for channels, and `CommunityID` for whole community - hydrate channels with members; channel members are now subset of community members - include channel permissions in periodic permissions check closes: status-im/status-desktop#10998
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package common
|
|
|
|
import (
|
|
"crypto/ecdsa"
|
|
|
|
"github.com/status-im/status-go/protocol/protobuf"
|
|
)
|
|
|
|
type CommKeyExMsgType uint8
|
|
|
|
const (
|
|
KeyExMsgNone CommKeyExMsgType = 0
|
|
KeyExMsgReuse CommKeyExMsgType = 1
|
|
KeyExMsgRekey CommKeyExMsgType = 2
|
|
)
|
|
|
|
// RawMessage represent a sent or received message, kept for being able
|
|
// to re-send/propagate
|
|
type RawMessage struct {
|
|
ID string
|
|
LocalChatID string
|
|
LastSent uint64
|
|
SendCount int
|
|
Sent bool
|
|
ResendAutomatically bool
|
|
SkipProtocolLayer bool // don't wrap message into ProtocolMessage
|
|
SendPushNotification bool
|
|
MessageType protobuf.ApplicationMetadataMessage_Type
|
|
Payload []byte
|
|
Sender *ecdsa.PrivateKey
|
|
Recipients []*ecdsa.PublicKey
|
|
SkipGroupMessageWrap bool
|
|
SendOnPersonalTopic bool
|
|
CommunityID []byte
|
|
CommunityKeyExMsgType CommKeyExMsgType
|
|
Ephemeral bool
|
|
BeforeDispatch func(*RawMessage) error
|
|
HashRatchetGroupID []byte
|
|
}
|