public static TrustRanks GetUserTrustRank(this APIUser user) { if (user != null) { if (user.developerType == APIUser.DeveloperType.Internal) // admin user { return(TrustRanks.Admin); } if (user.HasTag("system_legend")) // legend user { return(TrustRanks.Legendary); } if (user.hasLegendTrustLevel) // veteran user { return(TrustRanks.Veteran); } if (user.hasVeteranTrustLevel) // trusted user { return(TrustRanks.Trusted); } if (user.hasTrustedTrustLevel) // known user { return(TrustRanks.Known); } if (user.hasKnownTrustLevel) // user user { return(TrustRanks.User); } if (user.hasBasicTrustLevel) // new user { return(TrustRanks.New); } if (user.HasTag(string.Empty) && !user.canPublishAvatars) // visitor user { return(TrustRanks.Visitor); } } return(TrustRanks.Visitor); }