1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:37:21 +08:00

disallow current user from opening their own private channel

This commit is contained in:
LeNitrous 2019-06-03 17:25:19 +08:00
parent 78f8157e2b
commit 4e6d7137aa

View File

@ -81,6 +81,9 @@ namespace osu.Game.Online.Chat
if (user == null)
throw new ArgumentNullException(nameof(user));
if (user.Id == api.LocalUser.Value.Id)
return;
CurrentChannel.Value = JoinedChannels.FirstOrDefault(c => c.Type == ChannelType.PM && c.Users.Count == 1 && c.Users.Any(u => u.Id == user.Id))
?? new Channel(user);
}