fiX: handle commands with temp channels better

This commit is contained in:
Anna
2022-02-11 01:51:58 -05:00
parent 01373d3899
commit 18c311ace5
+4 -1
View File
@@ -463,6 +463,7 @@ internal sealed class ChatLog : IUiComponent {
this.AddBacklog(trimmed); this.AddBacklog(trimmed);
this._inputBacklogIdx = -1; this._inputBacklogIdx = -1;
if (!trimmed.StartsWith('/')) {
if (this._tellTarget != null) { if (this._tellTarget != null) {
var target = this._tellTarget; var target = this._tellTarget;
var reason = target.Reason; var reason = target.Reason;
@@ -482,11 +483,13 @@ internal sealed class ChatLog : IUiComponent {
goto Skip; goto Skip;
} }
if (this._tempChannel != null) { if (this._tempChannel != null) {
trimmed = $"{this._tempChannel.Value.Prefix()} {trimmed}"; trimmed = $"{this._tempChannel.Value.Prefix()} {trimmed}";
} else if (activeTab is { Channel: { } channel } && !trimmed.StartsWith('/')) { } else if (activeTab is { Channel: { } channel }) {
trimmed = $"{channel.Prefix()} {trimmed}"; trimmed = $"{channel.Prefix()} {trimmed}";
} }
}
this.Ui.Plugin.Common.Functions.Chat.SendMessage(trimmed); this.Ui.Plugin.Common.Functions.Chat.SendMessage(trimmed);
} }