Fix AKA usernames that cannot be disabled

This commit is contained in:
Howl 2016-11-23 23:09:06 +01:00
parent b0c4eb24e5
commit 5fd38f4595

View File

@ -50,7 +50,7 @@ func UsersSelfFavouriteModeGET(md common.MethodData) common.CodeMessager {
} }
type userSettingsData struct { type userSettingsData struct {
UsernameAKA string `json:"username_aka"` UsernameAKA *string `json:"username_aka"`
FavouriteMode *int `json:"favourite_mode"` FavouriteMode *int `json:"favourite_mode"`
CustomBadge struct { CustomBadge struct {
singleBadge singleBadge
@ -65,7 +65,7 @@ func UsersSelfSettingsPOST(md common.MethodData) common.CodeMessager {
md.RequestData.Unmarshal(&d) md.RequestData.Unmarshal(&d)
// input sanitisation // input sanitisation
d.UsernameAKA = common.SanitiseString(d.UsernameAKA) *d.UsernameAKA = common.SanitiseString(*d.UsernameAKA)
if md.User.UserPrivileges&common.UserPrivilegeDonor > 0 { if md.User.UserPrivileges&common.UserPrivilegeDonor > 0 {
d.CustomBadge.Name = common.SanitiseString(d.CustomBadge.Name) d.CustomBadge.Name = common.SanitiseString(d.CustomBadge.Name)
d.CustomBadge.Icon = sanitiseIconName(d.CustomBadge.Icon) d.CustomBadge.Icon = sanitiseIconName(d.CustomBadge.Icon)