mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 03:23:03 +08:00
Fix system user attempting to show in profile overlay
This commit is contained in:
parent
40f7c1bd99
commit
0be3ba946f
@ -15,11 +15,7 @@ namespace osu.Game.Online.Chat
|
||||
Timestamp = DateTimeOffset.Now;
|
||||
Content = message;
|
||||
|
||||
Sender = new User
|
||||
{
|
||||
Username = @"system",
|
||||
Colour = @"0000ff",
|
||||
};
|
||||
Sender = User.SystemUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,9 +77,11 @@ namespace osu.Game.Overlays
|
||||
|
||||
public void ShowUser(User user, bool fetchOnline = true)
|
||||
{
|
||||
if (user == User.SystemUser) return;
|
||||
|
||||
Show();
|
||||
|
||||
if (user.Id == Header?.User.Id)
|
||||
if (user.Id == Header?.User?.Id)
|
||||
return;
|
||||
|
||||
userReq?.Cancel();
|
||||
|
@ -144,5 +144,14 @@ namespace osu.Game.Users
|
||||
public Badge[] Badges;
|
||||
|
||||
public override string ToString() => Username;
|
||||
|
||||
/// <summary>
|
||||
/// A user instance for displaying locally created system messages.
|
||||
/// </summary>
|
||||
public static User SystemUser { get; } = new User
|
||||
{
|
||||
Username = "system",
|
||||
Id = 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user