Encrypted channels

This commit is contained in:
2024-05-12 22:00:22 +08:00
parent 13fcc64f79
commit 18af7eae81
5 changed files with 27 additions and 36 deletions

View File

@ -19,6 +19,7 @@ type Channel struct {
Type ChannelType `json:"type"`
Account Account `json:"account"`
AccountID uint `json:"account_id"`
IsEncrypted bool `json:"is_encrypted"`
Realm Realm `json:"realm"`
RealmID *uint `json:"realm_id"`

View File

@ -1,18 +1,15 @@
package models
import "gorm.io/datatypes"
type Message struct {
BaseModel
Content []byte `json:"content"`
Metadata datatypes.JSONMap `json:"metadata"`
Type string `json:"type"`
Attachments []Attachment `json:"attachments"`
Channel Channel `json:"channel"`
Sender ChannelMember `json:"sender"`
ReplyID *uint `json:"reply_id"`
ReplyTo *Message `json:"reply_to" gorm:"foreignKey:ReplyID"`
ChannelID uint `json:"channel_id"`
SenderID uint `json:"sender_id"`
Content []byte `json:"content"`
Type string `json:"type"`
Attachments []Attachment `json:"attachments"`
Channel Channel `json:"channel"`
Sender ChannelMember `json:"sender"`
ReplyID *uint `json:"reply_id"`
ReplyTo *Message `json:"reply_to" gorm:"foreignKey:ReplyID"`
ChannelID uint `json:"channel_id"`
SenderID uint `json:"sender_id"`
}