mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded
This commit is contained in:
@@ -1962,7 +1962,8 @@ func (c *Converter) ConversationToAPIConversation(
|
||||
return apiConversation, nil
|
||||
}
|
||||
|
||||
// DomainPermToAPIDomainPerm converts a gts model domin block or allow into an api domain permission.
|
||||
// DomainPermToAPIDomainPerm converts a gtsmodel domain block,
|
||||
// allow, draft, or ignore into an api domain permission.
|
||||
func (c *Converter) DomainPermToAPIDomainPerm(
|
||||
ctx context.Context,
|
||||
d gtsmodel.DomainPermission,
|
||||
@@ -1995,6 +1996,11 @@ func (c *Converter) DomainPermToAPIDomainPerm(
|
||||
domainPerm.CreatedBy = d.GetCreatedByAccountID()
|
||||
domainPerm.CreatedAt = util.FormatISO8601(d.GetCreatedAt())
|
||||
|
||||
// If this is a draft, also add the permission type.
|
||||
if _, ok := d.(*gtsmodel.DomainPermissionDraft); ok {
|
||||
domainPerm.PermissionType = d.GetType().String()
|
||||
}
|
||||
|
||||
return domainPerm, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user