diff --git a/app/v1/ping.go b/app/v1/ping.go index f9a84cc..d4cc63c 100644 --- a/app/v1/ping.go +++ b/app/v1/ping.go @@ -87,8 +87,11 @@ func surpriseMe() string { type pingResponse struct { common.ResponseBase - ID int `json:"user_id"` - Privileges uint64 `json:"privileges"` + ID int `json:"user_id"` + Privileges common.Privileges `json:"privileges"` + UserPrivileges common.UserPrivileges `json:"user_privileges"` + PrivilegesS string `json:"privileges_string"` + UserPrivilegesS string `json:"user_privileges_string"` } // PingGET is a message to check with the API that we are logged in, and know what are our privileges. @@ -103,7 +106,10 @@ func PingGET(md common.MethodData) common.CodeMessager { } r.ID = md.ID() - r.Privileges = uint64(md.User.TokenPrivileges) + r.Privileges = md.User.TokenPrivileges + r.UserPrivileges = md.User.UserPrivileges + r.PrivilegesS = md.User.TokenPrivileges.String() + r.UserPrivilegesS = md.User.UserPrivileges.String() return r } diff --git a/app/v1/user.go b/app/v1/user.go index bc6a731..9872812 100644 --- a/app/v1/user.go +++ b/app/v1/user.go @@ -34,7 +34,7 @@ SELECT users.id, users.username, register_datetime, privileges, latest_activity, users_stats.username_aka, users_stats.country FROM users -LEFT JOIN users_stats +INNER JOIN users_stats ON users.id=users_stats.id WHERE ` + whereClause + ` AND ` + md.User.OnlyUserPublic(true) + ` LIMIT 1` @@ -98,7 +98,7 @@ type modeData struct { Level float64 `json:"level"` Accuracy float64 `json:"accuracy"` PP int `json:"pp"` - GlobalLeaderboardRank int `json:"global_leaderboard_rank"` + GlobalLeaderboardRank *int `json:"global_leaderboard_rank"` } type userFullResponse struct { common.ResponseBase