From e597e7584708ad21742d89514affec82e5859014 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Thu, 29 Dec 2022 16:06:54 +0100 Subject: [PATCH] allow away and back to be collapsed This means we also apply the collapsing to normal queries, which might also collapse other things like joins / quits which may be undesired by some Fixes: https://github.com/thelounge/thelounge/issues/4583 --- client/components/MessageCondensed.vue | 12 ++++++++++++ client/components/MessageList.vue | 2 +- client/js/constants.ts | 12 +++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/client/components/MessageCondensed.vue b/client/components/MessageCondensed.vue index 6cf92b67..ba20283b 100644 --- a/client/components/MessageCondensed.vue +++ b/client/components/MessageCondensed.vue @@ -118,6 +118,18 @@ export default defineComponent({ (obj[type] > 1 ? " modes were set" : " mode was set") ); break; + case "away": + strings.push( + "marked away " + + (obj[type] > 1 ? String(obj[type]) + " times" : "once") + ); + break; + case "back": + strings.push( + "marked back " + + (obj[type] > 1 ? String(obj[type]) + " times" : "once") + ); + break; } } }); diff --git a/client/components/MessageList.vue b/client/components/MessageList.vue index 07791e03..b5779c91 100644 --- a/client/components/MessageList.vue +++ b/client/components/MessageList.vue @@ -177,7 +177,7 @@ export default defineComponent({ }); const condensedMessages = computed(() => { - if (props.channel.type !== "channel") { + if (props.channel.type !== "channel" && props.channel.type !== "query") { return props.channel.messages; } diff --git a/client/js/constants.ts b/client/js/constants.ts index e45decf4..a2885edb 100644 --- a/client/js/constants.ts +++ b/client/js/constants.ts @@ -17,7 +17,17 @@ const colorCodeMap = [ ["15", "Light Grey"], ]; -const condensedTypes = new Set(["chghost", "join", "part", "quit", "nick", "kick", "mode"]); +const condensedTypes = new Set([ + "away", + "back", + "chghost", + "join", + "kick", + "mode", + "nick", + "part", + "quit", +]); const timeFormats = { msgDefault: "HH:mm",