From eaf3d813f5748afb1d2c38fde0a71e35bb94cc00 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 18 Apr 2023 13:17:51 +0200 Subject: [PATCH] fix(avatar): Use conversation avatar in mention suggestion Signed-off-by: Joas Schilling --- src/components/NewMessageForm/NewMessageForm.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index 8322c5692c7..6006085537f 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -231,6 +231,7 @@ import Upload from 'vue-material-design-icons/Upload.vue' import { getCapabilities } from '@nextcloud/capabilities' import { getFilePickerBuilder, showError } from '@nextcloud/dialogs' +import { generateOcsUrl } from '@nextcloud/router' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' @@ -866,7 +867,12 @@ export default { // Set icon for candidate mentions that are not for users. if (possibleMention.source === 'calls') { - possibleMention.icon = 'icon-group-forced-white' + possibleMention.icon = 'icon-user-forced-white' + const darkTheme = window.getComputedStyle(document.body) + .getPropertyValue('--background-invert-if-dark') === 'invert(100%)' + possibleMention.iconUrl = generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar' + (darkTheme ? '/dark' : ''), { + token: this.token, + }) possibleMention.subline = t('spreed', 'Everyone') } else if (possibleMention.source === 'groups') { possibleMention.icon = 'icon-group-forced-white'