add emoji + tags

This commit is contained in:
tsmethurst
2021-04-04 16:08:26 +02:00
parent 23e2c4a567
commit bf93305931
6 changed files with 129 additions and 25 deletions

View File

@ -0,0 +1,37 @@
/*
GoToSocial
Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package model
import "time"
type Emoji struct {
ID string `pg:"type:uuid,default:gen_random_uuid(),pk,notnull"`
Shortcode string `pg:"notnull"`
CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
ImageFileName string
ImageContentType string
ImageFileSize string
ImageUpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
Disabled bool
URI string
ImageRemoteURL string
VisibleInPicker bool
CategoryID string
}

View File

@ -51,6 +51,12 @@ type Status struct {
// What is the activitystreams type of this status? See: https://www.w3.org/TR/activitystreams-vocabulary/#object-types
// Will probably almost always be Note but who knows!.
ActivityStreamsType ActivityStreamsObject
// Mentions created in this status -- will not be put in the database along with the status
Mentions []*Mention `pg:"-"`
// Hashtags used in this status -- will not be put in the database along with the status
Tags []*Tag `pg:"-"`
// Emojis used in this status -- will not be put in the database along with the status
Emojis []*Emoji `pg:"-"`
}
// Visibility represents the visibility granularity of a status.

36
internal/db/model/tag.go Normal file
View File

@ -0,0 +1,36 @@
/*
GoToSocial
Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package model
import "time"
type Tag struct {
ID string `pg:"type:uuid,default:gen_random_uuid(),pk,notnull"`
Name string `pg:"unique,notnull"`
CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
Useable bool
Trendable bool
Listable bool
ReviewedAt time.Time
RequestedReviewAt time.Time
LastStatusAt time.Time
MaxScore float32
MaxScoreAt time.Time
}