From 04d51b3514cb95273b26bd9a265a2c1ada0eb68c Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 12 Mar 2024 11:32:48 +0100 Subject: [PATCH] fix(federation): show proxy avatars in InvitationHandler Signed-off-by: Maksim Sukharev --- src/components/ConversationIcon.vue | 2 +- .../LeftSidebar/InvitationHandler.vue | 33 +++++++++++-------- src/stores/__tests__/federation.spec.js | 5 +-- src/stores/federation.ts | 4 +-- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/components/ConversationIcon.vue b/src/components/ConversationIcon.vue index 8c60e3178af..b294dd3f26d 100644 --- a/src/components/ConversationIcon.vue +++ b/src/components/ConversationIcon.vue @@ -179,7 +179,7 @@ export default { if (this.item.isDummyConversation) { // Prevent a 404 when trying to load an avatar before the conversation data is actually loaded // Also used in new conversation / invitation handler dialog - const isFed = this.item.isFederatedConversation && 'icon-conversation-federation' + const isFed = this.item.remoteServer && 'icon-conversation-federation' const type = this.item.type === CONVERSATION.TYPE.PUBLIC ? 'icon-conversation-public' : 'icon-conversation-group' const theme = isDarkTheme ? 'dark' : 'bright' return `${isFed || type} icon--dummy icon--${theme}` diff --git a/src/components/LeftSidebar/InvitationHandler.vue b/src/components/LeftSidebar/InvitationHandler.vue index 64091804d7c..cadc008337e 100644 --- a/src/components/LeftSidebar/InvitationHandler.vue +++ b/src/components/LeftSidebar/InvitationHandler.vue @@ -39,12 +39,10 @@ {{ item.roomName }} - - {{ t('spreed', 'From {user} at {remoteServer}', { - user: item.inviterDisplayName, - remoteServer: item.remoteServerUrl, - }) }} - + diff --git a/src/stores/__tests__/federation.spec.js b/src/stores/__tests__/federation.spec.js index 749ab1367a6..31237749c2b 100644 --- a/src/stores/__tests__/federation.spec.js +++ b/src/stores/__tests__/federation.spec.js @@ -16,7 +16,7 @@ describe('federationStore', () => { id: 2, userId: 'user0', state: 0, - localRoomId: 10, + localToken: 'TOKEN_LOCAL_2', remoteServerUrl: 'remote.nextcloud.com', remoteToken: 'TOKEN_2', remoteAttendeeId: 11, @@ -28,7 +28,7 @@ describe('federationStore', () => { id: 1, userId: 'user0', state: 1, - localRoomId: 9, + localToken: 'TOKEN_LOCAL_1', remoteServerUrl: 'remote.nextcloud.com', remoteToken: 'TOKEN_1', remoteAttendeeId: 11, @@ -158,6 +158,7 @@ describe('federationStore', () => { const room = { id: 10, + token: 'TOKEN_LOCAL_2' } const acceptResponse = generateOCSResponse({ payload: room }) acceptShare.mockResolvedValueOnce(acceptResponse) diff --git a/src/stores/federation.ts b/src/stores/federation.ts index d7a56c9b34d..5dd3af83f95 100644 --- a/src/stores/federation.ts +++ b/src/stores/federation.ts @@ -72,7 +72,7 @@ export const useFederationStore = defineStore('federation', { const { id, name } = notification.messageRichParameters.user1 const invitation: FederationInvite = { id: notification.objectId, - localRoomId: 0, + localToken: '', localCloudId: notification.user + '@' + getBaseUrl().replace('https://', ''), remoteAttendeeId: 0, remoteServerUrl, @@ -99,7 +99,7 @@ export const useFederationStore = defineStore('federation', { Vue.delete(this.pendingShares[id], 'loading') Vue.set(this.acceptedShares, id, { ...this.pendingShares[id], - localRoomId: conversation.id, + localToken: conversation.token, state: FEDERATION.STATE.ACCEPTED, }) Vue.delete(this.pendingShares, id)