- Not tested yet - Undo needs to be extended to also handle undo of follow
This commit is contained in:
parent
7e60188fb5
commit
d84a693b22
6 changed files with 130 additions and 17 deletions
|
@ -33,7 +33,7 @@ func newReaction(db *gorm.DB, opts ...gen.DOOption) reaction {
|
|||
_reaction.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_reaction.NoteId = field.NewString(tableName, "note_id")
|
||||
_reaction.ReactorId = field.NewString(tableName, "reactor_id")
|
||||
_reaction.EmoteId = field.NewUint(tableName, "emote_id")
|
||||
_reaction.EmoteId = field.NewField(tableName, "emote_id")
|
||||
_reaction.Note = reactionBelongsToNote{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
|
@ -430,7 +430,7 @@ type reaction struct {
|
|||
DeletedAt field.Field
|
||||
NoteId field.String
|
||||
ReactorId field.String
|
||||
EmoteId field.Uint
|
||||
EmoteId field.Field
|
||||
Note reactionBelongsToNote
|
||||
|
||||
Reactor reactionBelongsToReactor
|
||||
|
@ -458,7 +458,7 @@ func (r *reaction) updateTableName(table string) *reaction {
|
|||
r.DeletedAt = field.NewField(table, "deleted_at")
|
||||
r.NoteId = field.NewString(table, "note_id")
|
||||
r.ReactorId = field.NewString(table, "reactor_id")
|
||||
r.EmoteId = field.NewUint(table, "emote_id")
|
||||
r.EmoteId = field.NewField(table, "emote_id")
|
||||
|
||||
r.fillFieldMap()
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ func newUserToUserRelation(db *gorm.DB, opts ...gen.DOOption) userToUserRelation
|
|||
_userToUserRelation.ID = field.NewUint64(tableName, "id")
|
||||
_userToUserRelation.UserId = field.NewString(tableName, "user_id")
|
||||
_userToUserRelation.TargetUserId = field.NewString(tableName, "target_user_id")
|
||||
_userToUserRelation.Relation = field.NewField(tableName, "relation")
|
||||
_userToUserRelation.Relation = field.NewString(tableName, "relation")
|
||||
_userToUserRelation.User = userToUserRelationBelongsToUser{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
|
@ -222,7 +222,7 @@ type userToUserRelation struct {
|
|||
ID field.Uint64
|
||||
UserId field.String
|
||||
TargetUserId field.String
|
||||
Relation field.Field
|
||||
Relation field.String
|
||||
User userToUserRelationBelongsToUser
|
||||
|
||||
TargetUser userToUserRelationBelongsToTargetUser
|
||||
|
@ -245,7 +245,7 @@ func (u *userToUserRelation) updateTableName(table string) *userToUserRelation {
|
|||
u.ID = field.NewUint64(table, "id")
|
||||
u.UserId = field.NewString(table, "user_id")
|
||||
u.TargetUserId = field.NewString(table, "target_user_id")
|
||||
u.Relation = field.NewField(table, "relation")
|
||||
u.Relation = field.NewString(table, "relation")
|
||||
|
||||
u.fillFieldMap()
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ const (
|
|||
ActivitystreamsActivityTargetUser
|
||||
ActivitystreamsActivityTargetBoost
|
||||
ActivitystreamsActivityTargetReaction
|
||||
ActivitystreamsActivityTargetFollow
|
||||
)
|
||||
|
||||
func (n *ActivitystreamsActivityTargetType) Value() (driver.Value, error) {
|
||||
|
@ -29,4 +30,5 @@ var AllActivitystreamsActivityTargetTypes = []ActivitystreamsActivityTargetType{
|
|||
ActivitystreamsActivityTargetUser,
|
||||
ActivitystreamsActivityTargetBoost,
|
||||
ActivitystreamsActivityTargetReaction,
|
||||
ActivitystreamsActivityTargetFollow,
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ type RelationType string
|
|||
|
||||
const (
|
||||
RelationFollow RelationType = "follow" // X follows Y
|
||||
RelationFollowRequest RelationType = "follow-request" // X has requested to follow Y but is not yet following Y
|
||||
RelationMute RelationType = "mute" // X has Y muted (X doesn't see Y, but Y still X)
|
||||
RelationNoBoosts RelationType = "no-boosts" // X has Ys boosts muted
|
||||
RelationBlock RelationType = "block" // X has Y blocked (X doesn't see Y and Y doesn't see X)
|
||||
|
|
|
@ -9,5 +9,5 @@ type UserToUserRelation struct {
|
|||
UserId string
|
||||
TargetUser User // The user Y described in [RelationType]
|
||||
TargetUserId string
|
||||
Relation RelationType `gorm:"type:relation_type"`
|
||||
Relation string `gorm:"type:relation_type"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue