From ac35a03e62672d0485ea78eda3a33a1c56f7982b Mon Sep 17 00:00:00 2001 From: James Lyne Date: Thu, 7 Jan 2021 22:37:53 +0000 Subject: [PATCH] Show web chat messages in chat history --- src/api.ts | 9 +++++---- src/components/chat/ChatMessage.vue | 10 +++++----- src/dynmap.d.ts | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/api.ts b/src/api.ts index ce31c6f..156d77e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -445,7 +445,7 @@ function buildUpdates(data: Array): DynmapUpdates { } case 'chat': - if(!entry.account || !entry.message || !entry.timestamp) { + if(!entry.message || !entry.timestamp) { dropped.incomplete++; continue; } @@ -455,15 +455,16 @@ function buildUpdates(data: Array): DynmapUpdates { continue; } - if(entry.source !== 'player') { + if(entry.source !== 'player' && entry.source !== 'web') { dropped.notImplemented++; continue; } updates.chat.push({ type: 'chat', - playerAccount: entry.account, - playerName: entry.playerName || "", + source: entry.source || undefined, + playerAccount: entry.account || undefined, + playerName: entry.playerName || undefined, message: entry.message || "", timestamp: entry.timestamp, channel: entry.channel || undefined, diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue index 0118dd4..66b7eeb 100644 --- a/src/components/chat/ChatMessage.vue +++ b/src/components/chat/ChatMessage.vue @@ -16,7 +16,7 @@