diff --git a/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs b/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs index 2a56143c8..8437f595c 100644 --- a/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs +++ b/src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs @@ -17,7 +17,7 @@ namespace Discord.API.Client.GatewaySocket [JsonProperty("properties")] public Dictionary Properties { get; set; } [JsonProperty("large_threshold", NullValueHandling = NullValueHandling.Ignore)] - public int? LargeThreshold { get; set; } + public int LargeThreshold { get; set; } [JsonProperty("compress")] public bool UseCompression { get; set; } } diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs index 2aa3533ea..dd2706c85 100644 --- a/src/Discord.Net/DiscordClient.cs +++ b/src/Discord.Net/DiscordClient.cs @@ -896,12 +896,7 @@ namespace Discord break; } else - { - if (Config.UseLargeThreshold) - user = server.AddUser(data.User.Id); - else - user = server.GetUser(data.User.Id); - } + user = server.AddUser(data.User.Id); } if (user != null) diff --git a/src/Discord.Net/DiscordConfig.cs b/src/Discord.Net/DiscordConfig.cs index c22b60163..453f0952d 100644 --- a/src/Discord.Net/DiscordConfig.cs +++ b/src/Discord.Net/DiscordConfig.cs @@ -34,8 +34,6 @@ namespace Discord /// Gets or sets whether an encrypted login token should be saved to temp dir after successful login. public bool CacheToken { get; set; } = true; - /// Gets or sets whether Discord should send information about offline users, for servers with more than 100 users. - public bool UseLargeThreshold { get; set; } = false; /// Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. public int MessageCacheSize { get; set; } = 100; /// Gets or sets whether the permissions cache should be used. This makes operations such as User.GetPermissions(Channel), User.ServerPermissions and Channel.Members @@ -74,7 +72,7 @@ namespace Discord public int ReconnectDelay { get; } public int FailedReconnectDelay { get; } - public bool UseLargeThreshold { get; } + public int LargeThreshold { get; } = 250; public int MessageCacheSize { get; } public bool UsePermissionsCache { get; } public bool EnablePreUpdateEvents { get; } @@ -90,8 +88,7 @@ namespace Discord ConnectionTimeout = builder.ConnectionTimeout; ReconnectDelay = builder.ReconnectDelay; FailedReconnectDelay = builder.FailedReconnectDelay; - - UseLargeThreshold = builder.UseLargeThreshold; + MessageCacheSize = builder.MessageCacheSize; UsePermissionsCache = builder.UsePermissionsCache; EnablePreUpdateEvents = builder.EnablePreUpdateEvents; diff --git a/src/Discord.Net/Net/WebSockets/GatewaySocket.cs b/src/Discord.Net/Net/WebSockets/GatewaySocket.cs index 5ce370b51..bccdf10cc 100644 --- a/src/Discord.Net/Net/WebSockets/GatewaySocket.cs +++ b/src/Discord.Net/Net/WebSockets/GatewaySocket.cs @@ -161,7 +161,7 @@ namespace Discord.Net.WebSockets Version = 3, Token = token, Properties = props, - LargeThreshold = _config.UseLargeThreshold ? 100 : (int?)null, + LargeThreshold = _config.LargeThreshold, UseCompression = true }; QueueMessage(msg);