mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 20:07:25 +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;
|
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);
|
var request = new GetUserRequest(content);
|
||||||
request.Success += OpenPrivateChannel;
|
request.Success += OpenPrivateChannel;
|
||||||
request.Failure += _ => target.AddNewMessages(new ErrorMessage("User not found."));
|
request.Failure += _ => target.AddNewMessages(new ErrorMessage("User not found."));
|
||||||
|
Loading…
Reference in New Issue
Block a user