Skip to content

Commit 1f9212a

Browse files
committed
chore: updated deprecations and removed older obsolete methods
1 parent 7225fb5 commit 1f9212a

File tree

5 files changed

+6
-219
lines changed

5 files changed

+6
-219
lines changed

DiscordRPC/DiscordRpcClient.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,6 @@ public bool RegisterUriScheme(string steamAppID = null, string executable = null
716716
/// <param name="type">The event type to subscribe to</param>
717717
public void Subscribe(EventType type) { SetSubscription(Subscription | type); }
718718

719-
/// <summary>
720-
///
721-
/// </summary>
722-
/// <param name="type"></param>
723-
[System.Obsolete("Replaced with Unsubscribe", true)]
724-
public void Unubscribe(EventType type) { SetSubscription(Subscription & ~type); }
725-
726719
/// <summary>
727720
/// Unsubscribe from the event sent by discord. Used for Join / Spectate feature.
728721
/// <para>Requires the UriScheme to be registered.</para>

DiscordRPC/Entities/RichPresence.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,16 @@ public string DetailsUrl
125125
/// </summary>
126126
[JsonProperty("status_display_type", NullValueHandling = NullValueHandling.Ignore)]
127127
public StatusDisplayType StatusDisplay { get; set; }
128-
128+
129129

130130
/// <summary>
131131
/// Marks the <see cref="Secrets.MatchSecret"/> as a game session with a specific beginning and end. It was going to be used as a form of notification, but was replaced with the join feature. It may potentially have use in the future, but it currently has no use.
132132
/// <para>
133133
/// "TLDR it marks the matchSecret field as an instance, that is to say a context in game that’s not like a lobby state/not in game state. It was gonna he used for notify me, but we scrapped that for ask to join. We may put it to another use in the future. For now, don’t worry about it" - Mason (Discord API Server 14 / 03 / 2018)
134134
/// </para>
135135
/// </summary>
136-
[JsonProperty("instance", NullValueHandling = NullValueHandling.Ignore)]
137-
[Obsolete("This was going to be used, but was replaced by JoinSecret instead")]
138-
private bool Instance { get; set; }
136+
[Obsolete("This was going to be used, but was replaced by JoinSecret instead", true)]
137+
private bool Instance;
139138

140139
#region Has Checks
141140
/// <summary>
@@ -237,7 +236,6 @@ public static implicit operator bool(BaseRichPresence presence)
237236
/// <returns></returns>
238237
internal virtual bool Matches(RichPresence other)
239238
{
240-
#pragma warning disable CS0618 // Type or member is obsolete
241239
if (other == null)
242240
return false;
243241

@@ -266,7 +264,6 @@ internal virtual bool Matches(RichPresence other)
266264
{
267265
if (other.Secrets == null ||
268266
other.Secrets.JoinSecret != Secrets.JoinSecret ||
269-
other.Secrets.MatchSecret != Secrets.MatchSecret ||
270267
other.Secrets.SpectateSecret != Secrets.SpectateSecret)
271268
return false;
272269
}
@@ -307,8 +304,7 @@ internal virtual bool Matches(RichPresence other)
307304
return false;
308305
}
309306

310-
return Instance == other.Instance;
311-
#pragma warning restore CS0618 // Type or member is obsolete
307+
return true;
312308
}
313309

314310
/// <summary>

DiscordRPC/Entities/Secrets.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,8 @@ public class Secrets
1919
/// <para>This cannot be null and must be supplied for the Join / Spectate feature to work.</para>
2020
/// <para>Max Length of 128 characters</para>
2121
/// </summary>
22-
[Obsolete("This feature has been deprecated my Mason in issue #152 on the offical library. Was originally used as a Notify Me feature, it has been replaced with Join / Spectate.")]
23-
[JsonProperty("match", NullValueHandling = NullValueHandling.Ignore)]
24-
public string MatchSecret
25-
{
26-
get { return _matchSecret; }
27-
set
28-
{
29-
if (!BaseRichPresence.ValidateString(value, out _matchSecret, false, 128))
30-
throw new StringOutOfRangeException(128);
31-
}
32-
}
33-
private string _matchSecret;
22+
[Obsolete("This feature has been deprecated my Mason in issue #152 on the offical library. Was originally used as a Notify Me feature, it has been replaced with Join / Spectate.", true)]
23+
public string MatchSecret;
3424

3525
/// <summary>
3626
/// The secret data that will tell the client how to connect to the game to play. This could be a unique identifier for a fancy match maker or player id, lobby id, etc.

DiscordRPC/Logging/ConsoleLogger.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class ConsoleLogger : ILogger
2323
/// <summary>
2424
/// A alias too <see cref="Coloured"/>
2525
/// </summary>
26-
[System.Obsolete("Use Coloured")]
2726
public bool Colored {
2827
get => Coloured;
2928
set => Coloured = value;

DiscordRPC/Web/WebRPC.cs

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)