mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-22 23:52:56 -06:00
lots of stufffffffffffffffff
This commit is contained in:
parent
dc06e71b76
commit
8832784778
26 changed files with 721 additions and 88 deletions
|
|
@ -77,6 +77,9 @@ type TypeConverter interface {
|
|||
// InstanceToMasto converts a gts instance into its mastodon equivalent for serving at /api/v1/instance
|
||||
InstanceToMasto(i *gtsmodel.Instance) (*model.Instance, error)
|
||||
|
||||
// RelationshipToMasto converts a gts relationship into its mastodon equivalent for serving in various places
|
||||
RelationshipToMasto(r *gtsmodel.Relationship) (*model.Relationship, error)
|
||||
|
||||
/*
|
||||
FRONTEND (mastodon) MODEL TO INTERNAL (gts) MODEL
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -572,3 +572,21 @@ func (c *converter) InstanceToMasto(i *gtsmodel.Instance) (*model.Instance, erro
|
|||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
func (c *converter) RelationshipToMasto(r *gtsmodel.Relationship) (*model.Relationship, error) {
|
||||
return &model.Relationship{
|
||||
ID: r.ID,
|
||||
Following: r.Following,
|
||||
ShowingReblogs: r.ShowingReblogs,
|
||||
Notifying: r.Notifying,
|
||||
FollowedBy: r.FollowedBy,
|
||||
Blocking: r.Blocking,
|
||||
BlockedBy: r.BlockedBy,
|
||||
Muting: r.Muting,
|
||||
MutingNotifications: r.MutingNotifications,
|
||||
Requested: r.Requested,
|
||||
DomainBlocking: r.DomainBlocking,
|
||||
Endorsed: r.Endorsed,
|
||||
Note: r.Note,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue