diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 61cb38e8c20..16a070e9243 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -484,9 +484,6 @@ export default { // Discard notification if the conversation changes or closed this.notifyUnreadMessages(null) - - // FIXME collapse for group conversations until we show anything useful there - this.contentModeIndex = this.isOneToOne ? 1 : 0 }, immediate: true, diff --git a/src/components/RightSidebar/RightSidebarContent.vue b/src/components/RightSidebar/RightSidebarContent.vue index c70cd9f692f..74d2ac8f3f4 100644 --- a/src/components/RightSidebar/RightSidebarContent.vue +++ b/src/components/RightSidebar/RightSidebarContent.vue @@ -10,7 +10,7 @@ import type { UserProfileData, } from '../../types/index.ts' -import { t } from '@nextcloud/l10n' +import { n, t } from '@nextcloud/l10n' import { generateUrl } from '@nextcloud/router' import { useIsDarkTheme } from '@nextcloud/vue/composables/useIsDarkTheme' import { computed, ref, watch } from 'vue' @@ -23,6 +23,7 @@ import NcButton from '@nextcloud/vue/components/NcButton' import IconAccountOutline from 'vue-material-design-icons/AccountOutline.vue' import IconArrowLeft from 'vue-material-design-icons/ArrowLeft.vue' import IconClockOutline from 'vue-material-design-icons/ClockOutline.vue' +import IconDeleteClockOutline from 'vue-material-design-icons/DeleteClockOutline.vue' import IconMagnify from 'vue-material-design-icons/Magnify.vue' import IconOfficeBuildingOutline from 'vue-material-design-icons/OfficeBuildingOutline.vue' import CalendarEventSmall from '../UIShared/CalendarEventSmall.vue' @@ -81,6 +82,25 @@ const profileActions = computed(() => { return profileInfo.value.actions.filter((action) => action.id !== 'talk') }) +const isMessageExpirationSet = computed(() => { + return conversation.value.messageExpiration > 0 +}) + +const defaultExpirationOptions: Record = { + 3600: n('spreed', '%n hour', '%n hours', 1), + 28800: n('spreed', '%n hour', '%n hours', 8), + 86400: n('spreed', '%n day', '%n days', 1), + 604800: n('spreed', '%n week', '%n weeks', 1), + 2419200: n('spreed', '%n week', '%n weeks', 4), + 0: t('spreed', 'Off'), +} + +const messageExpirationDuration = computed(() => { + const { messageExpiration } = conversation.value + + return defaultExpirationOptions[messageExpiration] ?? t('spreed', 'Custom expiration time') +}) + const sidebarTitle = computed(() => { if (props.state === 'search') { return t('spreed', 'Search in {name}', { name: conversation.value.displayName }, { @@ -118,11 +138,19 @@ const avatarUrl = computed(() => { }) const profileInformation = computed(() => { - if (!profileInfo.value) { - return [] + const fields = [] + + if (isMessageExpirationSet.value) { + fields.push({ + key: 'expiration', + icon: IconDeleteClockOutline, + label: t('spreed', 'Message expiration set: {duration}', { duration: messageExpirationDuration.value }), + }) } - const fields = [] + if (!profileInfo.value) { + return fields + } if (profileInfo.value.role || profileInfo.value.pronouns) { fields.push({ @@ -255,7 +283,7 @@ function handleHeaderClick() { :title="sidebarTitle" @click="handleHeaderClick" />