mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge pull request #22544 from peppy/fix-change-join-leave-loop
Attempt to fix channel join / leave loop
This commit is contained in:
@ -95,7 +95,7 @@ namespace osu.Game.Online.Chat
|
||||
{
|
||||
connector.ChannelJoined += ch => Schedule(() => joinChannel(ch));
|
||||
|
||||
connector.ChannelParted += ch => Schedule(() => LeaveChannel(getChannel(ch)));
|
||||
connector.ChannelParted += ch => Schedule(() => leaveChannel(getChannel(ch), false));
|
||||
|
||||
connector.NewMessages += msgs => Schedule(() => addMessages(msgs));
|
||||
|
||||
@ -558,7 +558,9 @@ namespace osu.Game.Online.Chat
|
||||
/// Leave the specified channel. Can be called from any thread.
|
||||
/// </summary>
|
||||
/// <param name="channel">The channel to leave.</param>
|
||||
public void LeaveChannel(Channel channel) => Schedule(() =>
|
||||
public void LeaveChannel(Channel channel) => Schedule(() => leaveChannel(channel, true));
|
||||
|
||||
private void leaveChannel(Channel channel, bool sendLeaveRequest)
|
||||
{
|
||||
if (channel == null) return;
|
||||
|
||||
@ -581,10 +583,11 @@ namespace osu.Game.Online.Chat
|
||||
|
||||
if (channel.Joined.Value)
|
||||
{
|
||||
api.Queue(new LeaveChannelRequest(channel));
|
||||
if (sendLeaveRequest)
|
||||
api.Queue(new LeaveChannelRequest(channel));
|
||||
channel.Joined.Value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the most recently closed channel that has not already been reopened,
|
||||
|
Reference in New Issue
Block a user