status-go/protocol/common/raw_message.go
Richard Ramos f9ec588c4e feat: use protected topics for communities
refactor: associate chats to pubsub topics and populate these depending if the chat belongs to a community or not
refactor: add pubsub topic to mailserver batches
chore: ensure default relay messages continue working as they should
refactor: mailserver functions should be aware of pubsub topics
fix: use []byte for communityIDs
2023-08-23 13:56:00 -04:00

41 lines
1.1 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
PubsubTopic string
}