From f74f2b803bdc22743d63a2e56eca8cf5b61d2547 Mon Sep 17 00:00:00 2001 From: meli <57847713+ff-meli@users.noreply.github.com> Date: Mon, 17 Feb 2020 08:48:49 -0800 Subject: [PATCH] Fix incorrect error log in discord forwarding when the local player sends a chat. Player links are seemingly only included in the payload for clickable names; when the local player sends a chat message, the entire sender payload is just their name as text --- Dalamud/DiscordBot/DiscordBotManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dalamud/DiscordBot/DiscordBotManager.cs b/Dalamud/DiscordBot/DiscordBotManager.cs index 627c2960f..6b68961cc 100644 --- a/Dalamud/DiscordBot/DiscordBotManager.cs +++ b/Dalamud/DiscordBot/DiscordBotManager.cs @@ -187,7 +187,12 @@ namespace Dalamud.DiscordBot { string senderWorld; if (playerLink == null) { - Log.Error("playerLink was null. Sender: {0}", BitConverter.ToString(sender.RawData)); + // chat messages from the local player do not include a player link, and are just the raw name + // but we should still track other instances to know if this is ever an issue otherwise + if (parsedSender.TextValue != this.dalamud.ClientState.LocalPlayer.Name) + { + Log.Error("playerLink was null. Sender: {0}", BitConverter.ToString(sender.RawData)); + } senderName = wasOutgoingTell ? this.dalamud.ClientState.LocalPlayer.Name : parsedSender.TextValue; senderWorld = this.dalamud.ClientState.LocalPlayer.HomeWorld.Name;