Actually change message output based on statusMessage setting

This commit is contained in:
Pavel Djundik 2018-07-18 14:16:21 +03:00 committed by Pavel Djundik
parent c168e15db8
commit bc69ef5f0b
3 changed files with 15 additions and 9 deletions

View File

@ -7,8 +7,6 @@
:data-id="channel.id" :data-id="channel.id"
:class="{ :class="{
'hide-motd': !settings.motd, 'hide-motd': !settings.motd,
'hide-status-messages': settings.statusMessages === 'hidden',
'condensed-status-messages': settings.statusMessages === 'condensed',
'colored-nicks': settings.coloredNicks, 'colored-nicks': settings.coloredNicks,
'show-seconds': settings.showSeconds, 'show-seconds': settings.showSeconds,
}" }"
@ -54,7 +52,9 @@
<div <div
v-else v-else
class="chat-content"> class="chat-content">
<MessageList :channel="channel"/> <MessageList
:channel="channel"
:settings="settings"/>
<ChatUserList <ChatUserList
v-if="channel.type === 'channel'" v-if="channel.type === 'channel'"
:channel="channel"/> :channel="channel"/>

View File

@ -76,6 +76,7 @@ export default {
MessageCondensed, MessageCondensed,
}, },
props: { props: {
settings: Object,
channel: Object, channel: Object,
}, },
computed: { computed: {
@ -84,6 +85,16 @@ export default {
return this.channel.messages; 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 = []; const condensed = [];
let lastCondensedContainer = null; let lastCondensedContainer = null;

View File

@ -996,10 +996,6 @@ background on hover (unless active) */
} }
#chat .condensed-summary { #chat .condensed-summary {
display: none;
}
#chat.condensed-status-messages .condensed-summary {
display: flex; display: flex;
} }
@ -1011,7 +1007,7 @@ background on hover (unless active) */
opacity: 1; opacity: 1;
} }
#chat.condensed-status-messages .condensed.closed .msg { #chat .condensed.closed .msg {
display: none; display: none;
} }
@ -1306,7 +1302,6 @@ background on hover (unless active) */
width: 50px; width: 50px;
} }
#chat.hide-status-messages .condensed,
#chat.hide-motd .motd { #chat.hide-motd .motd {
display: none !important; display: none !important;
} }