From bc69ef5f0bb43ab694473805537d4107ad93e1ce Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 18 Jul 2018 14:16:21 +0300 Subject: [PATCH] Actually change message output based on statusMessage setting --- client/components/Chat.vue | 6 +++--- client/components/MessageList.vue | 11 +++++++++++ client/css/style.css | 7 +------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/client/components/Chat.vue b/client/components/Chat.vue index e42cfa0b..a6f38b39 100644 --- a/client/components/Chat.vue +++ b/client/components/Chat.vue @@ -7,8 +7,6 @@ :data-id="channel.id" :class="{ 'hide-motd': !settings.motd, - 'hide-status-messages': settings.statusMessages === 'hidden', - 'condensed-status-messages': settings.statusMessages === 'condensed', 'colored-nicks': settings.coloredNicks, 'show-seconds': settings.showSeconds, }" @@ -54,7 +52,9 @@
- + diff --git a/client/components/MessageList.vue b/client/components/MessageList.vue index e2e3eba0..a42f2be1 100644 --- a/client/components/MessageList.vue +++ b/client/components/MessageList.vue @@ -76,6 +76,7 @@ export default { MessageCondensed, }, props: { + settings: Object, channel: Object, }, computed: { @@ -84,6 +85,16 @@ export default { return this.channel.messages; } + // If actions are hidden, just return a message list with them excluded + if (this.settings.statusMessages === "hidden") { + return this.channel.messages.filter((message) => !constants.condensedTypes.includes(message.type)); + } + + // If actions are not condensed, just return raw message list + if (this.settings.statusMessages !== "condensed") { + return this.channel.messages; + } + const condensed = []; let lastCondensedContainer = null; diff --git a/client/css/style.css b/client/css/style.css index 05621a94..e1b5d44b 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -996,10 +996,6 @@ background on hover (unless active) */ } #chat .condensed-summary { - display: none; -} - -#chat.condensed-status-messages .condensed-summary { display: flex; } @@ -1011,7 +1007,7 @@ background on hover (unless active) */ opacity: 1; } -#chat.condensed-status-messages .condensed.closed .msg { +#chat .condensed.closed .msg { display: none; } @@ -1306,7 +1302,6 @@ background on hover (unless active) */ width: 50px; } -#chat.hide-status-messages .condensed, #chat.hide-motd .motd { display: none !important; }