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