comment and rename

This commit is contained in:
Melody Becker 2024-09-18 13:49:10 +02:00
parent 2eb222751c
commit 5a82179df6
3 changed files with 221 additions and 221 deletions

View file

@ -19,7 +19,7 @@ const (
// Store inbound jobs from api and ap in the db until they finished processing // Store inbound jobs from api and ap in the db until they finished processing
// Ensures data consistency in case the server is forced to restart unexpectedly // Ensures data consistency in case the server is forced to restart unexpectedly
// No DeletedAt field since don't want completed jobs to linger in the db for any longer than necessary // Inbound jobs must allways be processed in order from oldest to newest to ensure consistency
type InboundJob struct { type InboundJob struct {
gorm.Model gorm.Model
// Raw data, could be json or gob data, check source for how to interpret // Raw data, could be json or gob data, check source for how to interpret

View file

@ -5,7 +5,7 @@ import (
) )
//go:generate go build -o RolesGenerator ../cmd/RolesGenerator/main.go //go:generate go build -o RolesGenerator ../cmd/RolesGenerator/main.go
//go:generate ./RolesGenerator -input=roles.go -output=rolesUtil.go //go:generate ./RolesGenerator -input=roles.go -output=rolesUtil_generated.go
//go:generate rm RolesGenerator //go:generate rm RolesGenerator
// A role is, in concept, similar to how Discord handles roles // A role is, in concept, similar to how Discord handles roles

View file

@ -1,4 +1,4 @@
// This file is autogenerated, do not edit // Code generated by cmd/RolesGenerator DO NOT EDIT.
// If you need to refresh the content, run go generate again // If you need to refresh the content, run go generate again
package storage package storage
@ -8,89 +8,32 @@ func CollapseRolesIntoOne(roles ...*Role) Role {
startingRole := RoleDeepCopy(&DefaultUserRole) startingRole := RoleDeepCopy(&DefaultUserRole)
slices.SortFunc(roles, func(a, b *Role) int { return int(int64(a.Priority)-int64(b.Priority)) }) slices.SortFunc(roles, func(a, b *Role) int { return int(int64(a.Priority)-int64(b.Priority)) })
for _, role := range roles { for _, role := range roles {
if role.CanRecoverDeletedNotes != nil {
*startingRole.CanRecoverDeletedNotes = *role.CanRecoverDeletedNotes
}
if role.CanSendFollowerOnlyNotes != nil {
*startingRole.CanSendFollowerOnlyNotes = *role.CanSendFollowerOnlyNotes
}
if role.CanIncludeLinks != nil {
*startingRole.CanIncludeLinks = *role.CanIncludeLinks
}
if role.CanChangeDisplayName != nil {
*startingRole.CanChangeDisplayName = *role.CanChangeDisplayName
}
if role.CanSupressInteractionsBetweenUsers != nil { if role.CanSupressInteractionsBetweenUsers != nil {
*startingRole.CanSupressInteractionsBetweenUsers = *role.CanSupressInteractionsBetweenUsers *startingRole.CanSupressInteractionsBetweenUsers = *role.CanSupressInteractionsBetweenUsers
} }
if role.CanSendMedia != nil {
*startingRole.CanSendMedia = *role.CanSendMedia
}
if role.AutoCwPosts != nil {
*startingRole.AutoCwPosts = *role.AutoCwPosts
}
if role.CanDeleteNotes != nil {
*startingRole.CanDeleteNotes = *role.CanDeleteNotes
}
if role.CanAssignRoles != nil {
*startingRole.CanAssignRoles = *role.CanAssignRoles
}
if role.CanOverwriteDisplayNames != nil {
*startingRole.CanOverwriteDisplayNames = *role.CanOverwriteDisplayNames
}
if role.CanQuote != nil { if role.CanQuote != nil {
*startingRole.CanQuote = *role.CanQuote *startingRole.CanQuote = *role.CanQuote
} }
if role.CanBoost != nil { if role.CanIncludeSurvey != nil {
*startingRole.CanBoost = *role.CanBoost *startingRole.CanIncludeSurvey = *role.CanIncludeSurvey
}
if role.ScanCreatedLocalNotes != nil {
*startingRole.ScanCreatedLocalNotes = *role.ScanCreatedLocalNotes
}
if role.WithholdNotesBasedOnRegex != nil {
*startingRole.WithholdNotesBasedOnRegex = *role.WithholdNotesBasedOnRegex
}
if role.FullAdmin != nil {
*startingRole.FullAdmin = *role.FullAdmin
}
if role.CanManageCustomEmotes != nil {
*startingRole.CanManageCustomEmotes = *role.CanManageCustomEmotes
}
if role.CanViewDeletedNotes != nil {
*startingRole.CanViewDeletedNotes = *role.CanViewDeletedNotes
}
if role.CanManageAvatarDecorations != nil {
*startingRole.CanManageAvatarDecorations = *role.CanManageAvatarDecorations
}
if role.CanSendPublicNotes != nil {
*startingRole.CanSendPublicNotes = *role.CanSendPublicNotes
} }
if role.BlockedUsers != nil { if role.BlockedUsers != nil {
startingRole.BlockedUsers = append(startingRole.BlockedUsers, role.BlockedUsers...) startingRole.BlockedUsers = append(startingRole.BlockedUsers, role.BlockedUsers...)
} }
if role.MentionLimit != nil {
*startingRole.MentionLimit = *role.MentionLimit
}
if role.AutoCwPostsText != nil { if role.AutoCwPostsText != nil {
*startingRole.AutoCwPostsText = *role.AutoCwPostsText *startingRole.AutoCwPostsText = *role.AutoCwPostsText
} }
if role.CanIncludeSurvey != nil { if role.ScanCreatedLocalNotes != nil {
*startingRole.CanIncludeSurvey = *role.CanIncludeSurvey *startingRole.ScanCreatedLocalNotes = *role.ScanCreatedLocalNotes
}
if role.ScanCreatedPublicNotes != nil {
*startingRole.ScanCreatedPublicNotes = *role.ScanCreatedPublicNotes
}
if role.CanSendReplies != nil {
*startingRole.CanSendReplies = *role.CanSendReplies
}
if role.HasMentionCountLimit != nil {
*startingRole.HasMentionCountLimit = *role.HasMentionCountLimit
} }
if role.WithholdNotesForManualApproval != nil { if role.WithholdNotesForManualApproval != nil {
*startingRole.WithholdNotesForManualApproval = *role.WithholdNotesForManualApproval *startingRole.WithholdNotesForManualApproval = *role.WithholdNotesForManualApproval
} }
if role.CanConfirmWithheldNotes != nil { if role.FullAdmin != nil {
*startingRole.CanConfirmWithheldNotes = *role.CanConfirmWithheldNotes *startingRole.FullAdmin = *role.FullAdmin
}
if role.CanManageAvatarDecorations != nil {
*startingRole.CanManageAvatarDecorations = *role.CanManageAvatarDecorations
} }
if role.CanSendCustomEmotes != nil { if role.CanSendCustomEmotes != nil {
*startingRole.CanSendCustomEmotes = *role.CanSendCustomEmotes *startingRole.CanSendCustomEmotes = *role.CanSendCustomEmotes
@ -104,8 +47,29 @@ func CollapseRolesIntoOne(roles ...*Role) Role {
if role.CanSendPrivateNotes != nil { if role.CanSendPrivateNotes != nil {
*startingRole.CanSendPrivateNotes = *role.CanSendPrivateNotes *startingRole.CanSendPrivateNotes = *role.CanSendPrivateNotes
} }
if role.CanAffectOtherAdmins != nil { if role.AutoNsfwMedia != nil {
*startingRole.CanAffectOtherAdmins = *role.CanAffectOtherAdmins *startingRole.AutoNsfwMedia = *role.AutoNsfwMedia
}
if role.ScanCreatedPublicNotes != nil {
*startingRole.ScanCreatedPublicNotes = *role.ScanCreatedPublicNotes
}
if role.CanBoost != nil {
*startingRole.CanBoost = *role.CanBoost
}
if role.AutoCwPosts != nil {
*startingRole.AutoCwPosts = *role.AutoCwPosts
}
if role.WithholdNotesBasedOnRegex != nil {
*startingRole.WithholdNotesBasedOnRegex = *role.WithholdNotesBasedOnRegex
}
if role.CanSendAnnouncements != nil {
*startingRole.CanSendAnnouncements = *role.CanSendAnnouncements
}
if role.CanManageAds != nil {
*startingRole.CanManageAds = *role.CanManageAds
}
if role.CanIncludeLinks != nil {
*startingRole.CanIncludeLinks = *role.CanIncludeLinks
} }
if role.CanSubmitReports != nil { if role.CanSubmitReports != nil {
*startingRole.CanSubmitReports = *role.CanSubmitReports *startingRole.CanSubmitReports = *role.CanSubmitReports
@ -113,30 +77,66 @@ func CollapseRolesIntoOne(roles ...*Role) Role {
if role.CanLogin != nil { if role.CanLogin != nil {
*startingRole.CanLogin = *role.CanLogin *startingRole.CanLogin = *role.CanLogin
} }
if role.CanMentionOthers != nil { if role.MentionLimit != nil {
*startingRole.CanMentionOthers = *role.CanMentionOthers *startingRole.MentionLimit = *role.MentionLimit
}
if role.AutoNsfwMedia != nil {
*startingRole.AutoNsfwMedia = *role.AutoNsfwMedia
}
if role.CanManageAds != nil {
*startingRole.CanManageAds = *role.CanManageAds
}
if role.CanSendAnnouncements != nil {
*startingRole.CanSendAnnouncements = *role.CanSendAnnouncements
} }
if role.ScanCreatedFollowerOnlyNotes != nil { if role.ScanCreatedFollowerOnlyNotes != nil {
*startingRole.ScanCreatedFollowerOnlyNotes = *role.ScanCreatedFollowerOnlyNotes *startingRole.ScanCreatedFollowerOnlyNotes = *role.ScanCreatedFollowerOnlyNotes
} }
if role.ScanCreatedPrivateNotes != nil { if role.CanOverwriteDisplayNames != nil {
*startingRole.ScanCreatedPrivateNotes = *role.ScanCreatedPrivateNotes *startingRole.CanOverwriteDisplayNames = *role.CanOverwriteDisplayNames
}
if role.CanSendMedia != nil {
*startingRole.CanSendMedia = *role.CanSendMedia
}
if role.CanSendFollowerOnlyNotes != nil {
*startingRole.CanSendFollowerOnlyNotes = *role.CanSendFollowerOnlyNotes
}
if role.CanChangeDisplayName != nil {
*startingRole.CanChangeDisplayName = *role.CanChangeDisplayName
} }
if role.DisallowInteractionsWith != nil { if role.DisallowInteractionsWith != nil {
startingRole.DisallowInteractionsWith = append(startingRole.DisallowInteractionsWith, role.DisallowInteractionsWith...) startingRole.DisallowInteractionsWith = append(startingRole.DisallowInteractionsWith, role.DisallowInteractionsWith...)
} }
if role.CanViewDeletedNotes != nil {
*startingRole.CanViewDeletedNotes = *role.CanViewDeletedNotes
}
if role.CanRecoverDeletedNotes != nil {
*startingRole.CanRecoverDeletedNotes = *role.CanRecoverDeletedNotes
}
if role.ScanCreatedPrivateNotes != nil {
*startingRole.ScanCreatedPrivateNotes = *role.ScanCreatedPrivateNotes
}
if role.WithholdNotesRegexes != nil { if role.WithholdNotesRegexes != nil {
startingRole.WithholdNotesRegexes = append(startingRole.WithholdNotesRegexes, role.WithholdNotesRegexes...) startingRole.WithholdNotesRegexes = append(startingRole.WithholdNotesRegexes, role.WithholdNotesRegexes...)
} }
if role.CanManageCustomEmotes != nil {
*startingRole.CanManageCustomEmotes = *role.CanManageCustomEmotes
}
if role.CanMentionOthers != nil {
*startingRole.CanMentionOthers = *role.CanMentionOthers
}
if role.HasMentionCountLimit != nil {
*startingRole.HasMentionCountLimit = *role.HasMentionCountLimit
}
if role.CanAffectOtherAdmins != nil {
*startingRole.CanAffectOtherAdmins = *role.CanAffectOtherAdmins
}
if role.CanAssignRoles != nil {
*startingRole.CanAssignRoles = *role.CanAssignRoles
}
if role.CanSendPublicNotes != nil {
*startingRole.CanSendPublicNotes = *role.CanSendPublicNotes
}
if role.CanSendReplies != nil {
*startingRole.CanSendReplies = *role.CanSendReplies
}
if role.CanDeleteNotes != nil {
*startingRole.CanDeleteNotes = *role.CanDeleteNotes
}
if role.CanConfirmWithheldNotes != nil {
*startingRole.CanConfirmWithheldNotes = *role.CanConfirmWithheldNotes
}
} }
return startingRole return startingRole
} }
@ -149,6 +149,137 @@ func RoleDeepCopy(o *Role) Role {
n.Priority = o.Priority n.Priority = o.Priority
n.IsUserRole = o.IsUserRole n.IsUserRole = o.IsUserRole
n.IsBuiltIn = o.IsBuiltIn n.IsBuiltIn = o.IsBuiltIn
if o.CanOverwriteDisplayNames == nil { n.CanOverwriteDisplayNames = nil } else {
t := *o.CanOverwriteDisplayNames
n.CanOverwriteDisplayNames = &t
}
if o.CanManageAds == nil { n.CanManageAds = nil } else {
t := *o.CanManageAds
n.CanManageAds = &t
}
if o.CanIncludeLinks == nil { n.CanIncludeLinks = nil } else {
t := *o.CanIncludeLinks
n.CanIncludeLinks = &t
}
if o.CanSubmitReports == nil { n.CanSubmitReports = nil } else {
t := *o.CanSubmitReports
n.CanSubmitReports = &t
}
if o.CanLogin == nil { n.CanLogin = nil } else {
t := *o.CanLogin
n.CanLogin = &t
}
if o.MentionLimit == nil { n.MentionLimit = nil } else {
t := *o.MentionLimit
n.MentionLimit = &t
}
if o.ScanCreatedFollowerOnlyNotes == nil { n.ScanCreatedFollowerOnlyNotes = nil } else {
t := *o.ScanCreatedFollowerOnlyNotes
n.ScanCreatedFollowerOnlyNotes = &t
}
if o.CanRecoverDeletedNotes == nil { n.CanRecoverDeletedNotes = nil } else {
t := *o.CanRecoverDeletedNotes
n.CanRecoverDeletedNotes = &t
}
if o.CanSendMedia == nil { n.CanSendMedia = nil } else {
t := *o.CanSendMedia
n.CanSendMedia = &t
}
if o.CanSendFollowerOnlyNotes == nil { n.CanSendFollowerOnlyNotes = nil } else {
t := *o.CanSendFollowerOnlyNotes
n.CanSendFollowerOnlyNotes = &t
}
if o.CanChangeDisplayName == nil { n.CanChangeDisplayName = nil } else {
t := *o.CanChangeDisplayName
n.CanChangeDisplayName = &t
}
n.DisallowInteractionsWith = slices.Clone(o.DisallowInteractionsWith)
if o.CanViewDeletedNotes == nil { n.CanViewDeletedNotes = nil } else {
t := *o.CanViewDeletedNotes
n.CanViewDeletedNotes = &t
}
if o.ScanCreatedPrivateNotes == nil { n.ScanCreatedPrivateNotes = nil } else {
t := *o.ScanCreatedPrivateNotes
n.ScanCreatedPrivateNotes = &t
}
n.WithholdNotesRegexes = slices.Clone(o.WithholdNotesRegexes)
if o.CanManageCustomEmotes == nil { n.CanManageCustomEmotes = nil } else {
t := *o.CanManageCustomEmotes
n.CanManageCustomEmotes = &t
}
if o.CanMentionOthers == nil { n.CanMentionOthers = nil } else {
t := *o.CanMentionOthers
n.CanMentionOthers = &t
}
if o.HasMentionCountLimit == nil { n.HasMentionCountLimit = nil } else {
t := *o.HasMentionCountLimit
n.HasMentionCountLimit = &t
}
if o.CanAffectOtherAdmins == nil { n.CanAffectOtherAdmins = nil } else {
t := *o.CanAffectOtherAdmins
n.CanAffectOtherAdmins = &t
}
if o.CanAssignRoles == nil { n.CanAssignRoles = nil } else {
t := *o.CanAssignRoles
n.CanAssignRoles = &t
}
if o.CanSendPublicNotes == nil { n.CanSendPublicNotes = nil } else {
t := *o.CanSendPublicNotes
n.CanSendPublicNotes = &t
}
if o.CanSendReplies == nil { n.CanSendReplies = nil } else {
t := *o.CanSendReplies
n.CanSendReplies = &t
}
if o.CanDeleteNotes == nil { n.CanDeleteNotes = nil } else {
t := *o.CanDeleteNotes
n.CanDeleteNotes = &t
}
if o.CanConfirmWithheldNotes == nil { n.CanConfirmWithheldNotes = nil } else {
t := *o.CanConfirmWithheldNotes
n.CanConfirmWithheldNotes = &t
}
if o.WithholdNotesForManualApproval == nil { n.WithholdNotesForManualApproval = nil } else {
t := *o.WithholdNotesForManualApproval
n.WithholdNotesForManualApproval = &t
}
if o.CanSupressInteractionsBetweenUsers == nil { n.CanSupressInteractionsBetweenUsers = nil } else {
t := *o.CanSupressInteractionsBetweenUsers
n.CanSupressInteractionsBetweenUsers = &t
}
if o.CanQuote == nil { n.CanQuote = nil } else {
t := *o.CanQuote
n.CanQuote = &t
}
if o.CanIncludeSurvey == nil { n.CanIncludeSurvey = nil } else {
t := *o.CanIncludeSurvey
n.CanIncludeSurvey = &t
}
n.BlockedUsers = slices.Clone(o.BlockedUsers)
if o.AutoCwPostsText == nil { n.AutoCwPostsText = nil } else {
t := *o.AutoCwPostsText
n.AutoCwPostsText = &t
}
if o.ScanCreatedLocalNotes == nil { n.ScanCreatedLocalNotes = nil } else {
t := *o.ScanCreatedLocalNotes
n.ScanCreatedLocalNotes = &t
}
if o.ScanCreatedPublicNotes == nil { n.ScanCreatedPublicNotes = nil } else {
t := *o.ScanCreatedPublicNotes
n.ScanCreatedPublicNotes = &t
}
if o.FullAdmin == nil { n.FullAdmin = nil } else {
t := *o.FullAdmin
n.FullAdmin = &t
}
if o.CanManageAvatarDecorations == nil { n.CanManageAvatarDecorations = nil } else {
t := *o.CanManageAvatarDecorations
n.CanManageAvatarDecorations = &t
}
if o.CanSendCustomEmotes == nil { n.CanSendCustomEmotes = nil } else {
t := *o.CanSendCustomEmotes
n.CanSendCustomEmotes = &t
}
if o.CanSendCustomReactions == nil { n.CanSendCustomReactions = nil } else { if o.CanSendCustomReactions == nil { n.CanSendCustomReactions = nil } else {
t := *o.CanSendCustomReactions t := *o.CanSendCustomReactions
n.CanSendCustomReactions = &t n.CanSendCustomReactions = &t
@ -161,156 +292,25 @@ func RoleDeepCopy(o *Role) Role {
t := *o.CanSendPrivateNotes t := *o.CanSendPrivateNotes
n.CanSendPrivateNotes = &t n.CanSendPrivateNotes = &t
} }
if o.CanSendReplies == nil { n.CanSendReplies = nil } else {
t := *o.CanSendReplies
n.CanSendReplies = &t
}
if o.HasMentionCountLimit == nil { n.HasMentionCountLimit = nil } else {
t := *o.HasMentionCountLimit
n.HasMentionCountLimit = &t
}
if o.WithholdNotesForManualApproval == nil { n.WithholdNotesForManualApproval = nil } else {
t := *o.WithholdNotesForManualApproval
n.WithholdNotesForManualApproval = &t
}
if o.CanConfirmWithheldNotes == nil { n.CanConfirmWithheldNotes = nil } else {
t := *o.CanConfirmWithheldNotes
n.CanConfirmWithheldNotes = &t
}
if o.CanSendCustomEmotes == nil { n.CanSendCustomEmotes = nil } else {
t := *o.CanSendCustomEmotes
n.CanSendCustomEmotes = &t
}
if o.CanLogin == nil { n.CanLogin = nil } else {
t := *o.CanLogin
n.CanLogin = &t
}
if o.CanMentionOthers == nil { n.CanMentionOthers = nil } else {
t := *o.CanMentionOthers
n.CanMentionOthers = &t
}
if o.AutoNsfwMedia == nil { n.AutoNsfwMedia = nil } else { if o.AutoNsfwMedia == nil { n.AutoNsfwMedia = nil } else {
t := *o.AutoNsfwMedia t := *o.AutoNsfwMedia
n.AutoNsfwMedia = &t n.AutoNsfwMedia = &t
} }
if o.CanAffectOtherAdmins == nil { n.CanAffectOtherAdmins = nil } else {
t := *o.CanAffectOtherAdmins
n.CanAffectOtherAdmins = &t
}
if o.CanSubmitReports == nil { n.CanSubmitReports = nil } else {
t := *o.CanSubmitReports
n.CanSubmitReports = &t
}
if o.ScanCreatedPrivateNotes == nil { n.ScanCreatedPrivateNotes = nil } else {
t := *o.ScanCreatedPrivateNotes
n.ScanCreatedPrivateNotes = &t
}
n.DisallowInteractionsWith = slices.Clone(o.DisallowInteractionsWith)
n.WithholdNotesRegexes = slices.Clone(o.WithholdNotesRegexes)
if o.CanManageAds == nil { n.CanManageAds = nil } else {
t := *o.CanManageAds
n.CanManageAds = &t
}
if o.CanSendAnnouncements == nil { n.CanSendAnnouncements = nil } else {
t := *o.CanSendAnnouncements
n.CanSendAnnouncements = &t
}
if o.ScanCreatedFollowerOnlyNotes == nil { n.ScanCreatedFollowerOnlyNotes = nil } else {
t := *o.ScanCreatedFollowerOnlyNotes
n.ScanCreatedFollowerOnlyNotes = &t
}
if o.CanIncludeLinks == nil { n.CanIncludeLinks = nil } else {
t := *o.CanIncludeLinks
n.CanIncludeLinks = &t
}
if o.CanChangeDisplayName == nil { n.CanChangeDisplayName = nil } else {
t := *o.CanChangeDisplayName
n.CanChangeDisplayName = &t
}
if o.CanSupressInteractionsBetweenUsers == nil { n.CanSupressInteractionsBetweenUsers = nil } else {
t := *o.CanSupressInteractionsBetweenUsers
n.CanSupressInteractionsBetweenUsers = &t
}
if o.CanRecoverDeletedNotes == nil { n.CanRecoverDeletedNotes = nil } else {
t := *o.CanRecoverDeletedNotes
n.CanRecoverDeletedNotes = &t
}
if o.CanSendFollowerOnlyNotes == nil { n.CanSendFollowerOnlyNotes = nil } else {
t := *o.CanSendFollowerOnlyNotes
n.CanSendFollowerOnlyNotes = &t
}
if o.AutoCwPosts == nil { n.AutoCwPosts = nil } else {
t := *o.AutoCwPosts
n.AutoCwPosts = &t
}
if o.CanDeleteNotes == nil { n.CanDeleteNotes = nil } else {
t := *o.CanDeleteNotes
n.CanDeleteNotes = &t
}
if o.CanSendMedia == nil { n.CanSendMedia = nil } else {
t := *o.CanSendMedia
n.CanSendMedia = &t
}
if o.CanBoost == nil { n.CanBoost = nil } else { if o.CanBoost == nil { n.CanBoost = nil } else {
t := *o.CanBoost t := *o.CanBoost
n.CanBoost = &t n.CanBoost = &t
} }
if o.ScanCreatedLocalNotes == nil { n.ScanCreatedLocalNotes = nil } else { if o.AutoCwPosts == nil { n.AutoCwPosts = nil } else {
t := *o.ScanCreatedLocalNotes t := *o.AutoCwPosts
n.ScanCreatedLocalNotes = &t n.AutoCwPosts = &t
} }
if o.WithholdNotesBasedOnRegex == nil { n.WithholdNotesBasedOnRegex = nil } else { if o.WithholdNotesBasedOnRegex == nil { n.WithholdNotesBasedOnRegex = nil } else {
t := *o.WithholdNotesBasedOnRegex t := *o.WithholdNotesBasedOnRegex
n.WithholdNotesBasedOnRegex = &t n.WithholdNotesBasedOnRegex = &t
} }
if o.CanAssignRoles == nil { n.CanAssignRoles = nil } else { if o.CanSendAnnouncements == nil { n.CanSendAnnouncements = nil } else {
t := *o.CanAssignRoles t := *o.CanSendAnnouncements
n.CanAssignRoles = &t n.CanSendAnnouncements = &t
}
if o.CanOverwriteDisplayNames == nil { n.CanOverwriteDisplayNames = nil } else {
t := *o.CanOverwriteDisplayNames
n.CanOverwriteDisplayNames = &t
}
if o.CanQuote == nil { n.CanQuote = nil } else {
t := *o.CanQuote
n.CanQuote = &t
}
n.BlockedUsers = slices.Clone(o.BlockedUsers)
if o.MentionLimit == nil { n.MentionLimit = nil } else {
t := *o.MentionLimit
n.MentionLimit = &t
}
if o.AutoCwPostsText == nil { n.AutoCwPostsText = nil } else {
t := *o.AutoCwPostsText
n.AutoCwPostsText = &t
}
if o.FullAdmin == nil { n.FullAdmin = nil } else {
t := *o.FullAdmin
n.FullAdmin = &t
}
if o.CanManageCustomEmotes == nil { n.CanManageCustomEmotes = nil } else {
t := *o.CanManageCustomEmotes
n.CanManageCustomEmotes = &t
}
if o.CanViewDeletedNotes == nil { n.CanViewDeletedNotes = nil } else {
t := *o.CanViewDeletedNotes
n.CanViewDeletedNotes = &t
}
if o.CanManageAvatarDecorations == nil { n.CanManageAvatarDecorations = nil } else {
t := *o.CanManageAvatarDecorations
n.CanManageAvatarDecorations = &t
}
if o.CanSendPublicNotes == nil { n.CanSendPublicNotes = nil } else {
t := *o.CanSendPublicNotes
n.CanSendPublicNotes = &t
}
if o.ScanCreatedPublicNotes == nil { n.ScanCreatedPublicNotes = nil } else {
t := *o.ScanCreatedPublicNotes
n.ScanCreatedPublicNotes = &t
}
if o.CanIncludeSurvey == nil { n.CanIncludeSurvey = nil } else {
t := *o.CanIncludeSurvey
n.CanIncludeSurvey = &t
} }
return n return n
} }