From 78907675a1e2a27f65ba0fb20dbfb002cc2b9c00 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2023 13:53:07 +0200 Subject: [PATCH 1/3] fix(chat): Use the conversation avatar for mention chips Signed-off-by: Joas Schilling --- .../MessagesGroup/Message/MessagePart/Mention.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue index 4bffda11c12..851854e3944 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue @@ -23,7 +23,7 @@
+import { generateOcsUrl } from '@nextcloud/router' + import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js' export default { @@ -88,6 +90,15 @@ export default { return this.$store.getters.getActorType() === 'users' && this.id === this.$store.getters.getUserId() }, + isDarkTheme() { + return window.getComputedStyle(document.body) + .getPropertyValue('--background-invert-if-dark') === 'invert(100%)' + }, + avatarUrl() { + return generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar' + (this.darkTheme ? '/dark' : ''), { + token: this.id, + }) + }, }, } From e909e4c339dffa7bb63092531d9ef577baf99a07 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2023 13:53:33 +0200 Subject: [PATCH 2/3] fix(chat): Fix missing avatar icon for mention bubbles in chat input Signed-off-by: Joas Schilling --- css/icons.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/css/icons.css b/css/icons.css index 68cc2cb1a96..5fc3bb26fbd 100644 --- a/css/icons.css +++ b/css/icons.css @@ -71,10 +71,12 @@ * .app-Talk rules above. * "forced-white" needs to be included in the class name as the Avatar does * not accept several classes. */ +.mention-bubble__icon.icon-group-forced-white, .tribute-container .icon-group-forced-white { background-image: url(../img/icon-contacts-white.svg); } +.mention-bubble__icon.icon-user-forced-white, .tribute-container .icon-user-forced-white { background-image: url(../img/icon-user-white.svg) } From 25ffdcb5bc72b69d5ae467f3ac14d3340d16a6ac Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Apr 2023 14:00:12 +0200 Subject: [PATCH 3/3] fix(chat): Render groups with mention chips Signed-off-by: Joas Schilling --- src/components/MessagesList/MessagesGroup/Message/Message.vue | 2 +- .../MessagesList/MessagesGroup/Message/MessagePart/Mention.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index 4fa1835f89e..3e1dfe6dd0e 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -519,7 +519,7 @@ export default { Object.keys(this.messageParameters).forEach(function(p) { const type = this.messageParameters[p].type const mimetype = this.messageParameters[p].mimetype - if (type === 'user' || type === 'call' || type === 'guest' || type === 'group') { + if (type === 'user' || type === 'call' || type === 'guest' || type === 'user-group' || type === 'group') { richParameters[p] = { component: Mention, props: this.messageParameters[p], diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue index 851854e3944..b394cc17f9c 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/Mention.vue @@ -72,7 +72,7 @@ export default { return this.type === 'call' }, isGroupMention() { - return this.type === 'group' + return this.type === 'user-group' || this.type === 'group' }, isMentionToGuest() { return this.type === 'guest'