discord-rpc-csharp
discord-rpc-csharp copied to clipboard
[BUG] Rich Presences don't do equality checks
Describe the bug Equality between presences are not considered
To Reproduce Steps to reproduce the behavior:
- Create a rich presence (A)
- Create another rich presence with the same values as A. (B)
- Test for equality between Rich Presence A and Rich Presence B
- Equality returns false
Expected behavior Equality is considered
Desktop (please complete the following information):
- OS: Windows
- Framework: .NET 9
- Library Version: 1.2.1.24
Additional context
presence == _currentPresence // returns false
Newtonsoft.Json.JsonConvert.SerializeObject(presence) == Newtonsoft.Json.JsonConvert.SerializeObject(_currentPresence) // returns true
This is due to the default equality check being a reference basedcheck instead of a value based check.