Prep for reactions, some fixes and improvements
Some checks failed
/ docker (push) Failing after 1m35s
Some checks failed
/ docker (push) Failing after 1m35s
This commit is contained in:
parent
4b62c32247
commit
8947d97825
13 changed files with 262 additions and 43 deletions
|
@ -1,15 +1,21 @@
|
|||
package models
|
||||
|
||||
import "gorm.io/gorm"
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Emotes are combinations of a name, the server it originated from
|
||||
// and the media for it
|
||||
// and the media for it. Only represents custom emotes, not characters found in unicode
|
||||
//
|
||||
// TODO: Include the case of unicode icons being used as emote
|
||||
type Emote struct {
|
||||
gorm.Model // Standard gorm model for id and timestamps
|
||||
Metadata MediaMetadata // The media used by this emote
|
||||
MetadataId string // Id of the media information, primarily for gorm
|
||||
ID string `gorm:"primarykey"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||
Metadata MediaMetadata // The media used by this emote
|
||||
MetadataId string // Id of the media information, primarily for gorm
|
||||
// Name of the emote. Also the text for using it in a message (ex. :bob:)
|
||||
Name string
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
@ -10,12 +11,15 @@ import (
|
|||
// A reaction may contain some content text. If yes, this is the reaction.
|
||||
// It also may contain a specifically linked emote (via tag). If yes, this is the reaction and takes precedence over the content
|
||||
type Reaction struct {
|
||||
gorm.Model
|
||||
ID string `gorm:"primarykey"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||
Note Note
|
||||
NoteId string
|
||||
Reactor User
|
||||
ReactorId string
|
||||
Emote *Emote // Emote is optional. If not set, use the default emote of the server
|
||||
EmoteId sql.NullInt64
|
||||
EmoteId sql.NullString
|
||||
Content sql.NullString // Content/text of the reaction. Used for example in cases where a unicode character is sent as emote reaction
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue