-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix discord "view beatmap" button being shown when editing and hide identifiable information is set #30848
Fix discord "view beatmap" button being shown when editing and hide identifiable information is set #30848
Conversation
Joehuu
commented
Nov 23, 2024
- Overlooked in When discord is set to privacy mode, don't show beatmap being edited #27440
Before | After |
---|---|
…dentifiable information is set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine otherwise I guess.
osu.Desktop/DiscordRichPresence.cs
Outdated
if (getBeatmapID(activity.Value) is int beatmapId && beatmapId > 0) | ||
if (getBeatmapID(activity.Value) is int beatmapId | ||
&& beatmapId > 0 | ||
&& !(activity.Value is UserActivity.EditingBeatmap && hideIdentifiableInformation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is back-to-front coding, UserActivity
should expose a method for this rather than hardcoding the types in here. E.g. ShowsBeatmapInfo(bool hideIdentifiableInformation = false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably call it CanShowBeatmapInfo
or ShouldShowBeatmapInfo
, but agree with the change.
/// <summary> | ||
/// Returns the ID of the beatmap involved in this activity, if applicable and/or available. | ||
/// </summary> | ||
/// <param name="hideIdentifiableInformation"></param> | ||
public virtual int? GetBeatmapID(bool hideIdentifiableInformation = false) => null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One may say this should not exist in UserActivity
itself, but the only other option I can think of is to define an interface that exposes this method and implement such interface on InGame
and EditingBeatmap
, and I'm smelling some scent of over-engineering in that so I just chose to define it at a base level for now.
On addressing #30848 (comment), I've had to change my suggestion slightly as it appears we already did pattern matching in |