25 lines
804 B
Go
25 lines
804 B
Go
package models
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// A Reaction is a user liking a note (optionally using an emote)
|
|
// 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 {
|
|
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.NullString
|
|
Content sql.NullString // Content/text of the reaction. Used for example in cases where a unicode character is sent as emote reaction
|
|
}
|