Merge pull request #34 from ff-meli/playername_error_fix

Fix incorrect error log in discord forwarding when the local player s…
This commit is contained in:
goaaats 2020-02-19 17:41:35 +09:00 committed by GitHub
commit 766a6f3f85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;