Browse Source

Renamed Joined, Archived, and Locked to HasJoined, IsArchived, and IsLocked

pull/1923/head
quin lynch 3 years ago
parent
commit
a4bfe6e411
3 changed files with 15 additions and 15 deletions
  1. +3
    -3
      src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs
  2. +6
    -6
      src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs
  3. +6
    -6
      src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs

+ 3
- 3
src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs View File

@@ -19,12 +19,12 @@ namespace Discord
/// <summary>
/// <see langword="true"/> if the current user has joined this thread, otherwise <see langword="false"/>.
/// </summary>
bool Joined { get; }
bool HasJoined { get; }

/// <summary>
/// <see langword="true"/> if the current thread is archived, otherwise <see langword="false"/>.
/// </summary>
bool Archived { get; }
bool IsArchived { get; }

/// <summary>
/// Duration to automatically archive the thread after recent activity.
@@ -39,7 +39,7 @@ namespace Discord
/// <summary>
/// <see langword="true"/> if the current thread is locked, otherwise <see langword="false"/>
/// </summary>
bool Locked { get; }
bool IsLocked { get; }

/// <summary>
/// An approximate count of users in a thread, stops counting at 50.


+ 6
- 6
src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs View File

@@ -16,10 +16,10 @@ namespace Discord.Rest
{
public ThreadType Type { get; private set; }
/// <inheritdoc/>
public bool Joined { get; private set; }
public bool HasJoined { get; private set; }

/// <inheritdoc/>
public bool Archived { get; private set; }
public bool IsArchived { get; private set; }

/// <inheritdoc/>
public ThreadArchiveDuration AutoArchiveDuration { get; private set; }
@@ -28,7 +28,7 @@ namespace Discord.Rest
public DateTimeOffset ArchiveTimestamp { get; private set; }

/// <inheritdoc/>
public bool Locked { get; private set; }
public bool IsLocked { get; private set; }

/// <inheritdoc/>
public int MemberCount { get; private set; }
@@ -58,14 +58,14 @@ namespace Discord.Rest
{
base.Update(model);

Joined = model.ThreadMember.IsSpecified;
HasJoined = model.ThreadMember.IsSpecified;

if (model.ThreadMetadata.IsSpecified)
{
Archived = model.ThreadMetadata.Value.Archived;
IsArchived = model.ThreadMetadata.Value.Archived;
AutoArchiveDuration = model.ThreadMetadata.Value.AutoArchiveDuration;
ArchiveTimestamp = model.ThreadMetadata.Value.ArchiveTimestamp;
Locked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false);
IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false);
}



+ 6
- 6
src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs View File

@@ -35,7 +35,7 @@ namespace Discord.WebSocket
=> Users.FirstOrDefault(x => x.Id == Discord.CurrentUser.Id);

/// <inheritdoc/>
public bool Joined { get; private set; }
public bool HasJoined { get; private set; }

/// <summary>
/// <see langword="true"/> if this thread is private, otherwise <see langword="false"/>
@@ -55,7 +55,7 @@ namespace Discord.WebSocket
public int MemberCount { get; private set; }

/// <inheritdoc/>
public bool Archived { get; private set; }
public bool IsArchived { get; private set; }

/// <inheritdoc/>
public DateTimeOffset ArchiveTimestamp { get; private set; }
@@ -64,7 +64,7 @@ namespace Discord.WebSocket
public ThreadArchiveDuration AutoArchiveDuration { get; private set; }

/// <inheritdoc/>
public bool Locked { get; private set; }
public bool IsLocked { get; private set; }

/// <summary>
/// Gets a collection of cached users within this thread.
@@ -106,10 +106,10 @@ namespace Discord.WebSocket
if (model.ThreadMetadata.IsSpecified)
{
Archived = model.ThreadMetadata.Value.Archived;
IsArchived = model.ThreadMetadata.Value.Archived;
ArchiveTimestamp = model.ThreadMetadata.Value.ArchiveTimestamp;
AutoArchiveDuration = (ThreadArchiveDuration)model.ThreadMetadata.Value.AutoArchiveDuration;
Locked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false);
IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false);
}

if (model.OwnerId.IsSpecified)
@@ -117,7 +117,7 @@ namespace Discord.WebSocket
Owner = GetUser(model.OwnerId.Value);
}

Joined = model.ThreadMember.IsSpecified;
HasJoined = model.ThreadMember.IsSpecified;
}

internal IReadOnlyCollection<SocketThreadUser> RemoveUsers(ulong[] users)


Loading…
Cancel
Save