check if user joined requested channel already

This commit is contained in:
Davran Dilshat 2021-09-07 17:06:12 +01:00
parent 5c385e84ea
commit f54d5675db

View File

@ -264,6 +264,11 @@ namespace osu.Game.Online.Chat
break;
}
// Check if the user has joined requested channel already.
var alreadyJoinedChannel = JoinedChannels.FirstOrDefault(c => c.Type == ChannelType.PM && c.Users.Count == 1 && c.Name == content);
if (alreadyJoinedChannel != null)
CurrentChannel.Value = alreadyJoinedChannel;
var request = new GetUserRequest(content);
request.Success += OpenPrivateChannel;
request.Failure += _ => target.AddNewMessages(new ErrorMessage("User not found."));