1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Revert "Add functionality to switch to successfully joined channel"

This reverts commit c72e8a8b5e.
This commit is contained in:
Salman Ahmed 2022-03-10 22:50:02 +03:00
parent e419370830
commit 8086f73451

View File

@ -420,11 +420,10 @@ namespace osu.Game.Online.Chat
/// Joins a channel if it has not already been joined. Must be called from the update thread.
/// </summary>
/// <param name="channel">The channel to join.</param>
/// <param name="switchToJoined">Switch <see cref="CurrentChannel"/> to the joined channel on successful request.</param>
/// <returns>The joined channel. Note that this may not match the parameter channel as it is a backed object.</returns>
public Channel JoinChannel(Channel channel, bool switchToJoined = false) => joinChannel(channel, switchToJoined, true);
public Channel JoinChannel(Channel channel) => joinChannel(channel, true);
private Channel joinChannel(Channel channel, bool switchToJoined = false, bool fetchInitialMessages = false)
private Channel joinChannel(Channel channel, bool fetchInitialMessages = false)
{
if (channel == null) return null;
@ -440,7 +439,7 @@ namespace osu.Game.Online.Chat
case ChannelType.Multiplayer:
// join is implicit. happens when you join a multiplayer game.
// this will probably change in the future.
joinChannel(channel, switchToJoined, fetchInitialMessages);
joinChannel(channel, fetchInitialMessages);
return channel;
case ChannelType.PM:
@ -461,7 +460,7 @@ namespace osu.Game.Online.Chat
default:
var req = new JoinChannelRequest(channel);
req.Success += () => joinChannel(channel, switchToJoined, fetchInitialMessages);
req.Success += () => joinChannel(channel, fetchInitialMessages);
req.Failure += ex => LeaveChannel(channel);
api.Queue(req);
return channel;
@ -473,8 +472,7 @@ namespace osu.Game.Online.Chat
this.fetchInitialMessages(channel);
}
if (switchToJoined || CurrentChannel.Value == null)
CurrentChannel.Value = channel;
CurrentChannel.Value ??= channel;
return channel;
}