mirror of
https://github.com/ppy/osu.git
synced 2025-01-29 05:52:56 +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;
|
Timestamp = DateTimeOffset.Now;
|
||||||
Content = message;
|
Content = message;
|
||||||
|
|
||||||
Sender = new User
|
Sender = User.SystemUser;
|
||||||
{
|
|
||||||
Username = @"system",
|
|
||||||
Colour = @"0000ff",
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,11 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public void ShowUser(User user, bool fetchOnline = true)
|
public void ShowUser(User user, bool fetchOnline = true)
|
||||||
{
|
{
|
||||||
|
if (user == User.SystemUser) return;
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
if (user.Id == Header?.User.Id)
|
if (user.Id == Header?.User?.Id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
userReq?.Cancel();
|
userReq?.Cancel();
|
||||||
|
@ -144,5 +144,14 @@ namespace osu.Game.Users
|
|||||||
public Badge[] Badges;
|
public Badge[] Badges;
|
||||||
|
|
||||||
public override string ToString() => Username;
|
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