1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Fix actions posted to the wrong channel

This commit is contained in:
smoogipoo 2021-06-29 15:58:07 +09:00
parent f547afe617
commit 9132c42f87
2 changed files with 10 additions and 3 deletions

View File

@ -225,7 +225,7 @@ namespace osu.Game.Online.Chat
switch (command)
{
case "np":
AddInternal(new NowPlayingCommand());
AddInternal(new NowPlayingCommand(target));
break;
case "me":
@ -235,7 +235,7 @@ namespace osu.Game.Online.Chat
break;
}
PostMessage(content, true);
PostMessage(content, true, target);
break;
case "join":

View File

@ -21,6 +21,13 @@ namespace osu.Game.Online.Chat
[Resolved]
private Bindable<WorkingBeatmap> currentBeatmap { get; set; }
private readonly Channel target;
public NowPlayingCommand(Channel target)
{
this.target = target;
}
protected override void LoadComplete()
{
base.LoadComplete();
@ -48,7 +55,7 @@ namespace osu.Game.Online.Chat
var beatmapString = beatmap.OnlineBeatmapID.HasValue ? $"[{api.WebsiteRootUrl}/b/{beatmap.OnlineBeatmapID} {beatmap}]" : beatmap.ToString();
channelManager.PostMessage($"is {verb} {beatmapString}", true);
channelManager.PostMessage($"is {verb} {beatmapString}", true, target);
Expire();
}
}