diff --git a/src/Discord.Net.Core/Entities/Users/IUser.cs b/src/Discord.Net.Core/Entities/Users/IUser.cs index a92f96f7e..aeb65aa9c 100644 --- a/src/Discord.Net.Core/Entities/Users/IUser.cs +++ b/src/Discord.Net.Core/Entities/Users/IUser.cs @@ -24,7 +24,7 @@ namespace Discord /// Adds this user as a friend, this will remove a block Task AddFriendAsync(RequestOptions options = null); - /// Blocks this user, and removes friend relation + /// Blocks this user, and removes the user as a friend Task BlockUserAsync(RequestOptions options = null); /// Removes the relationship of this user Task RemoveRelationshipAsync(RequestOptions options = null); diff --git a/src/Discord.Net.WebSocket/ClientState.cs b/src/Discord.Net.WebSocket/ClientState.cs index 5586577d6..09a273386 100644 --- a/src/Discord.Net.WebSocket/ClientState.cs +++ b/src/Discord.Net.WebSocket/ClientState.cs @@ -16,7 +16,7 @@ namespace Discord.WebSocket private readonly ConcurrentDictionary _dmChannels; private readonly ConcurrentDictionary _guilds; private readonly ConcurrentDictionary _users; - private readonly ConcurrentDictionary _relations; + private readonly ConcurrentDictionary _relationships; private readonly ConcurrentHashSet _groupChannels; internal IReadOnlyCollection Channels => _channels.ToReadOnlyCollection(); @@ -24,7 +24,7 @@ namespace Discord.WebSocket internal IReadOnlyCollection GroupChannels => _groupChannels.Select(x => GetChannel(x) as SocketGroupChannel).ToReadOnlyCollection(_groupChannels); internal IReadOnlyCollection Guilds => _guilds.ToReadOnlyCollection(); internal IReadOnlyCollection Users => _users.ToReadOnlyCollection(); - internal IReadOnlyCollection Relationships => _relations.ToReadOnlyCollection(); + internal IReadOnlyCollection Relationships => _relationships.ToReadOnlyCollection(); internal IReadOnlyCollection PrivateChannels => _dmChannels.Select(x => x.Value as ISocketPrivateChannel).Concat( @@ -39,7 +39,7 @@ namespace Discord.WebSocket _dmChannels = new ConcurrentDictionary(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(dmChannelCount * CollectionMultiplier)); _guilds = new ConcurrentDictionary(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(guildCount * CollectionMultiplier)); _users = new ConcurrentDictionary(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(estimatedUsersCount * CollectionMultiplier)); - _relations = new ConcurrentDictionary(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(AverageRelationshipsPerUser * CollectionMultiplier)); + _relationships = new ConcurrentDictionary(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(AverageRelationshipsPerUser * CollectionMultiplier)); _groupChannels = new ConcurrentHashSet(ConcurrentHashSet.DefaultConcurrencyLevel, (int)(10 * CollectionMultiplier)); } @@ -133,17 +133,17 @@ namespace Discord.WebSocket internal SocketRelationship GetRelationship(ulong id) { - if (_relations.TryGetValue(id, out SocketRelationship value)) + if (_relationships.TryGetValue(id, out SocketRelationship value)) return value; return null; } - internal void AddRelationship(SocketRelationship relation) + internal void AddRelationship(SocketRelationship relationship) { - _relations[relation.User.Id] = relation; + _relationships[relationship.User.Id] = relationship; } internal SocketRelationship RemoveRelationship(ulong id) { - if (_relations.TryRemove(id, out SocketRelationship value)) + if (_relationships.TryRemove(id, out SocketRelationship value)) return value; return null; } diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index ed1053d58..393e29a20 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -1685,9 +1685,9 @@ namespace Discord.WebSocket } internal SocketRelationship AddRelationship(Relationship model, ClientState state) { - var relation = SocketRelationship.Create(this, state, model); + var relationship = SocketRelationship.Create(this, state, model); state.AddRelationship(SocketRelationship.Create(this, state, model)); - return relation; + return relationship; } internal SocketRelationship RemoveRelationship(ulong id) { diff --git a/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs b/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs index 3b92141d7..2b29311ff 100644 --- a/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs +++ b/src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs @@ -1,6 +1,5 @@ using Discord.Rest; using System; -using System.Linq; using System.Threading.Tasks; using Model = Discord.API.User; using PresenceModel = Discord.API.Presence;