mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +08:00
check if user joined requested channel already
This commit is contained in:
parent
5c385e84ea
commit
f54d5675db
@ -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."));
|
||||
|
Loading…
Reference in New Issue
Block a user