Add constructor to create a PM channel from a User

This commit is contained in:
Dean Herbert
2018-12-07 13:56:21 +09:00
parent 2122966cd4
commit 2f9de149dd
2 changed files with 12 additions and 1 deletions

View File

@ -79,7 +79,7 @@ namespace osu.Game.Online.Chat
throw new ArgumentNullException(nameof(user));
CurrentChannel.Value = JoinedChannels.FirstOrDefault(c => c.Type == ChannelType.PM && c.Users.Count == 1 && c.Users.Any(u => u.Id == user.Id))
?? new Channel { Name = user.Username, Users = { user }, Type = ChannelType.PM };
?? new Channel(user);
}
private void currentChannelChanged(Channel channel) => JoinChannel(channel);