From 7c48447d5018484b4dae4c41301faadb76355a94 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Wed, 23 Aug 2023 16:35:34 +0300 Subject: [PATCH] fix: restored community links old unfurling (#11988) --- .../shared/views/chat/LinksMessageView.qml | 18 +++++------------- ui/imports/shared/views/chat/MessageView.qml | 10 ++++++---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/ui/imports/shared/views/chat/LinksMessageView.qml b/ui/imports/shared/views/chat/LinksMessageView.qml index b867e808de..bc4b6c808f 100644 --- a/ui/imports/shared/views/chat/LinksMessageView.qml +++ b/ui/imports/shared/views/chat/LinksMessageView.qml @@ -326,17 +326,12 @@ ColumnLayout { name: "loadImage" when: tempLoader.unfurl && tempLoader.isImage PropertyChanges { target: tempLoader; sourceComponent: unfurledImageComponent } + }, + State { + name: "statusInvitation" + when: tempLoader.unfurl && tempLoader.isStatusDeepLink + PropertyChanges { target: tempLoader; sourceComponent: invitationBubble } } -// State { -// name: "loadLinkPreview" -// when: unfurl && !isImage && !isStatusDeepLink -// PropertyChanges { target: tempLoader; sourceComponent: unfurledLinkComponent } -// }, -// State { -// name: "statusInvitation" -// when: unfurl && isStatusDeepLink -// PropertyChanges { target: tempLoader; sourceComponent: invitationBubble } -// } ] } } @@ -453,7 +448,4 @@ ColumnLayout { } } } - - - } diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index f5a9aaf883..8f43bfa1ed 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -71,10 +71,12 @@ Loader { return [] const separator = " " const arr = links.split(separator) - const filtered = arr.filter(v => v.toLowerCase().endsWith('.gif')) - const out = filtered.join(separator) - console.log(`<<<${arr}->${out}`) - return out + const filtered = arr.filter(v => { + const u = v.toLowerCase() + return u.endsWith('.gif') + || u.includes(Constants.externalStatusLink) + }) + return filtered.join(separator) } property string responseToMessageWithId: ""