mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-19 20:06:14 -06:00
move stuff around + further work on domain blocks
This commit is contained in:
parent
c7192c0431
commit
5e2ba03adc
29 changed files with 279 additions and 50 deletions
|
|
@ -76,6 +76,8 @@ type TypeConverter interface {
|
|||
RelationshipToMasto(r *gtsmodel.Relationship) (*model.Relationship, error)
|
||||
// NotificationToMasto converts a gts notification into a mastodon notification
|
||||
NotificationToMasto(n *gtsmodel.Notification) (*model.Notification, error)
|
||||
// DomainBlockTomasto converts a gts model domin block into a mastodon domain block, for serving at /api/v1/admin/domain_blocks
|
||||
DomainBlockToMasto(b *gtsmodel.DomainBlock) (*model.DomainBlock, error)
|
||||
|
||||
/*
|
||||
FRONTEND (mastodon) MODEL TO INTERNAL (gts) MODEL
|
||||
|
|
|
|||
|
|
@ -644,3 +644,16 @@ func (c *converter) NotificationToMasto(n *gtsmodel.Notification) (*model.Notifi
|
|||
Status: mastoStatus,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *converter) DomainBlockToMasto(b *gtsmodel.DomainBlock) (*model.DomainBlock, error) {
|
||||
return &model.DomainBlock{
|
||||
ID: b.ID,
|
||||
Domain: b.Domain,
|
||||
Obfuscate: b.Obfuscate,
|
||||
PrivateComment: b.PrivateComment,
|
||||
PublicComment: b.PublicComment,
|
||||
SubscriptionID: b.SubscriptionID,
|
||||
CreatedBy: b.CreatedByAccountID,
|
||||
CreatedAt: b.CreatedAt.Format(time.RFC3339),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue