added admin user dialog definition and minor change to dialog manager it needs

This commit is contained in:
2026-02-16 23:06:48 -07:00
parent 5070eb0a79
commit a9bbbcb6b5
2 changed files with 217 additions and 0 deletions
+7
View File
@@ -241,6 +241,13 @@ func (fld *DialogItem) IsEmpty() bool {
return len(fld.Value) == 0
}
// SetTargetUser alters a dialog's content to reflect a target user.
func (d *Dialog) SetTargetUser(u *database.User) {
d.Title = strings.ReplaceAll(d.Title, "[USERNAME]", u.Username)
d.Subtitle = strings.ReplaceAll(d.Subtitle, "[USERNAME]", u.Username)
d.Action = strings.ReplaceAll(d.Action, "[USERNAME]", u.Username)
}
// SetCommunity alters a dialog's content to reflect the community.
func (d *Dialog) SetCommunity(comm *database.Community) {
d.Title = strings.ReplaceAll(d.Title, "[CNAME]", comm.Name)