Compare commits

...
23 Commits
Author SHA1 Message Date
Ibrahem Khalil 59553362d1 Merge branch 'develop' into 17116 2023-12-04 15:19:39 +02:00
Ibrkhalil 2f1ee972c2 Better syntax 2023-12-03 16:27:11 +02:00
Ibrkhalil 3b3743d7a7 Handle uniqueness 2023-12-03 16:26:00 +02:00
Ibrkhalil 3a1737b65e Bump go 2023-12-03 16:01:14 +02:00
Ibrkhalil 2b78d323dc clean 2023-12-03 15:45:45 +02:00
Ibrkhalil 79ee136826 Cater for sending community URL 2023-12-03 15:43:43 +02:00
Ibrkhalil bf3886ea18 Bump go 2023-12-03 13:04:54 +02:00
Ibrkhalil ff1068b53b Lint 2023-12-03 12:16:21 +02:00
Ibrahem Khalil 622df31a12 Change default value for loading? 2023-12-02 19:01:45 +02:00
Ibrahem Khalil ab8f65e6fa Merge branch 'develop' into 17116 2023-12-02 18:49:33 +02:00
Ibrkhalil 9674142fdc Bump go 2023-12-02 18:39:09 +02:00
Ibrkhalil e18ca22ff7 Add component 2023-12-02 18:37:24 +02:00
Ibrkhalil 31c226fcba Bump go and update endpoint 2023-12-02 11:17:50 +02:00
Ibrkhalil 292e3b7167 Bump go 2023-12-02 10:18:52 +02:00
Ibrkhalil 4c818ebaa6 Bump go 2023-12-02 10:15:07 +02:00
Ibrkhalil a83fa4df87 Improvements 2023-11-29 22:20:00 +02:00
Ibrkhalil 3782cd5808 clean 2023-11-29 21:57:59 +02:00
Ibrkhalil d1b094f986 Bump go 2023-11-29 21:57:00 +02:00
Ibrahem Khalil 6a8f061627 Merge branch 'develop' into 17116 2023-11-26 14:18:58 +02:00
Ibrkhalil eef9f45834 Add community invitation type 2023-11-26 14:18:16 +02:00
Ibrahem Khalil 865659552d Merge branch 'develop' into 17116 2023-11-21 19:52:22 +02:00
ibrkhalil 656e545957 Bump status-go 2023-11-21 19:48:06 +02:00
Ibrahem f9979a14c2 Test 2023-08-28 16:49:06 +03:00
18 changed files with 450 additions and 86 deletions
@@ -0,0 +1,35 @@
(ns quo.components.status-link-previews.community.component-spec
(:require
[quo.components.status-link-previews.community.view :as view]
[test-helpers.component :as h]))
(def props
{:title "Some title"
:description "Some description"
:link "status.im"
:logo "data:image/png,logo-x"
:thumbnail "data:image/png,whatever"
:member-count 20
:active-members-count 20})
(h/describe "Status link previews - Community"
(h/test "default render"
(h/render [view/view])
(h/is-truthy (h/query-by-label-text :link-preview))
(h/is-null (h/query-by-label-text :button-enable-preview)))
(h/test "renders with most common props"
(h/render [view/view props])
(h/is-truthy (h/query-by-text (:title props)))
(h/is-truthy (h/query-by-text (:description props)))
(h/is-truthy (h/query-by-text (:link props)))
(h/is-truthy (h/query-by-label-text :logo))
(h/is-truthy (h/query-by-label-text :thumbnail)))
(h/test "does not render thumbnail if prop is not present"
(h/render [view/view (dissoc props :thumbnail)])
(h/is-null (h/query-by-label-text :thumbnail)))
(h/test "does not render logo if prop is not present"
(h/render [view/view (dissoc props :logo)])
(h/is-null (h/query-by-label-text :logo))))
@@ -0,0 +1,51 @@
(ns quo.components.status-link-previews.community.style
(:require [quo.foundations.colors :as colors]))
(defn loading-circle
[theme]
{:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
:margin-right 4
:width 16
:height 16
:border-radius 16})
(defn loading-stat
[theme]
{:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
:margin-right 4
:width 32
:height 8
:border-radius 16})
(def loading-stat-container {:flex-direction :row :align-items :center :margin-right 12})
(defn loading-first-line-bar
[theme]
{:style {:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
:width 145
:height 16
:border-radius 6}})
(defn loading-second-line-bar
[theme]
{:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
:width 112
:height 8
:border-radius 6
:margin-bottom 17})
(defn loading-thumbnail-box
[theme]
{:background-color (colors/theme-colors colors/neutral-5 colors/neutral-80 theme)
:margin-right 4
:width 271
:height 139
:border-radius 16})
(def thumbnail
{:width "100%"
:height 139
:margin-top 8
:border-radius 12})
(def row-spacing {:flex-direction :row :margin-bottom 12})
@@ -0,0 +1,101 @@
(ns quo.components.status-link-previews.community.view
(:require
[quo.components.community.community-stat.view :as community-stat]
[quo.components.links.link-preview.style :as style]
[quo.components.markdown.text :as text]
[quo.components.status-link-previews.community.style :as status-link-previews-style]
[quo.theme :as theme]
[react-native.core :as rn]))
(defn- description-comp
[description members-count active-members-count]
[rn/view
[text/text
{:size :paragraph-2
:number-of-lines 3
:accessibility-label :description} description]
[rn/view {:flex-direction :row :margin-top 12}
[community-stat/view
{:value members-count
:icon :i/members
:accessibility-label :members-count
:style {:margin-right 12}}]
[community-stat/view
{:value (or active-members-count 0)
:icon :i/active-members
:accessibility-label :active-members-count}]]])
(defn- title-comp
[title]
[text/text
{:size :paragraph-1
:number-of-lines 1
:weight :semi-bold
:style style/title
:accessibility-label :title}
title])
(defn- thumbnail-comp
[thumbnail]
[rn/image
{:style status-link-previews-style/thumbnail
:source (if (string? thumbnail)
{:uri thumbnail}
thumbnail)
:accessibility-label :thumbnail}])
(defn- logo-comp
[logo]
[rn/image
{:accessibility-label :logo
:source (if (string? logo)
{:uri logo}
logo)
:style style/logo}])
(defn- stat-loading
[theme]
[rn/view {:style status-link-previews-style/loading-stat-container}
[rn/view {:style (status-link-previews-style/loading-circle theme)}]
[rn/view {:style (status-link-previews-style/loading-stat theme)}]])
(defn- loading-view
[theme]
[rn/view
{:accessibility-label :loading}
[rn/view {:style status-link-previews-style/row-spacing}
[rn/view (status-link-previews-style/loading-circle theme)]
[rn/view (status-link-previews-style/loading-first-line-bar theme)]]
[rn/view {:style (status-link-previews-style/loading-second-line-bar theme)}]
[rn/view status-link-previews-style/row-spacing
[stat-loading theme]
[stat-loading theme]]
[rn/view {:style (status-link-previews-style/loading-thumbnail-box theme)}]])
(defn f-internal-view
[{:keys [title description loading? thumbnail-size icon banner members-count active-members-count
theme on-press]
:or {loading? false}}]
[rn/touchable-opacity
{:style (merge (style/container (not loading?))
{:width 295
:height 245})
:accessibility-label :link-preview
:on-press on-press}
(if loading?
[loading-view theme]
[:<>
[rn/view {:style style/header-container}
(when icon
[logo-comp icon])
[title-comp title]]
(when description
[description-comp description members-count active-members-count])
(when banner
[thumbnail-comp banner thumbnail-size])])])
(defn- internal-view
[props]
[:f> f-internal-view props])
(def view (theme/with-theme internal-view))
-1
View File
@@ -107,4 +107,3 @@
[tag-resources size type resource icon-color label text-color labelled?]]]))
(def tag (quo.theme/with-theme tag-internal))
+4
View File
@@ -125,6 +125,7 @@
quo.components.settings.settings-item.view
quo.components.share.qr-code.view
quo.components.share.share-qr-code.view
quo.components.status-link-previews.community.view
quo.components.switchers.group-messaging-card.view
quo.components.tabs.account-selector
quo.components.tabs.segmented-tab
@@ -281,6 +282,9 @@
(def url-preview quo.components.links.url-preview.view/view)
(def url-preview-list quo.components.links.url-preview-list.view/view)
;;;; Status links
(def status-link-preview-community quo.components.status-link-previews.community.view/view)
;;;; List items
(def account-item quo.components.list-items.account.view/view)
(def account-list-card quo.components.list-items.account-list-card.view/view)
+67 -27
View File
@@ -147,15 +147,48 @@
preferred-name (get-in db [:profile/profile :preferred-name])
emoji? (message-content/emoji-only-content? {:text input-text
:response-to message-id})]
{:chat-id current-chat-id
:content-type (if emoji?
constants/content-type-emoji
constants/content-type-text)
:text input-text
:response-to message-id
:ens-name preferred-name
:link-previews (map #(select-keys % [:url :title :description :thumbnail])
(get-in db [:chat/link-previews :unfurled]))})))
{:chat-id current-chat-id
:content-type (if emoji?
constants/content-type-emoji
constants/content-type-text)
:text input-text
:response-to message-id
:ens-name preferred-name
:link-previews (map #(select-keys % [:url :title :description :thumbnail])
(get-in db [:chat/link-previews :unfurled]))
:status-link-previews (map (fn [item]
{:url (:url item)
:community
{:community-id (get-in item [:community :community-id])
:color (get-in item
[:community :color])
:description (get-in item
[:community :description])
:display-name (get-in item
[:community :display-name])
:members-count (get-in item
[:community :members-count])
:active-members-count (get-in item
[:community :active-members-count])
:icon {:data-uri (get-in item
[:community :icon
:data-uri])
:width (get-in item
[:community :icon
:width])
:height (get-in item
[:community :icon
:height])}
:banner {:data-uri (get-in item
[:community :banner
:data-uri])
:width (get-in item
[:community :banner
:width])
:height (get-in item
[:community :banner
:height])}}})
(get-in db [:chat/status-link-previews :unfurled]))})))
(defn build-image-messages
[{db :db} chat-id input-text]
@@ -193,6 +226,7 @@
(rf/merge cofx
(clean-input current-chat-id)
(link-preview/reset-unfurled)
(link-preview/clear-status-link-previews)
(mentions/clear-mentions))))
(rf/defn send-messages
@@ -205,6 +239,7 @@
(rf/merge cofx
(clean-input (:current-chat-id db))
(link-preview/reset-unfurled)
(link-preview/clear-status-link-previews)
(chat.message/send-messages messages)))))
(rf/defn send-audio-message
@@ -239,25 +274,30 @@
:as cofx} text {:keys [message-id quoted-message chat-id]}]
(rf/merge
cofx
{:json-rpc/call [{:method "wakuext_editMessage"
:params [{:id message-id
:text text
:content-type (if (message-content/emoji-only-content?
{:text text
:response-to quoted-message})
constants/content-type-emoji
constants/content-type-text)
:linkPreviews (map #(-> %
(select-keys [:url :title :description
:thumbnail])
data-store-messages/->link-preview-rpc)
(get-in db [:chat/link-previews :unfurled]))}]
:js-response true
:on-error #(log/error "failed to edit message " %)
:on-success (fn [result]
(re-frame/dispatch [:sanitize-messages-and-process-response
result]))}]}
{:json-rpc/call
[{:method "wakuext_editMessage"
:params [{:id message-id
:text text
:content-type (if (message-content/emoji-only-content?
{:text text
:response-to quoted-message})
constants/content-type-emoji
constants/content-type-text)
:linkPreviews (map #(-> %
(select-keys [:url :title :description
:thumbnail])
data-store-messages/->link-preview-rpc)
(get-in db [:chat/link-previews :unfurled]))
:statusLinkPreviews (map
data-store-messages/<-status-link-previews-rpc
(get-in db [:chat/status-link-previews :unfurled]))}]
:js-response true
:on-error #(log/error "failed to edit message " %)
:on-success (fn [result]
(re-frame/dispatch [:sanitize-messages-and-process-response
result]))}]}
(link-preview/reset-unfurled)
(link-preview/clear-status-link-previews)
(cancel-message-edit)))
(rf/defn send-current-message
+1 -1
View File
@@ -326,7 +326,7 @@
(conj contacts user-pk)
contacts)]
(when (seq pks)
{:json-rpc/call [{:method "wakuext_shareCommunity"
{:json-rpc/call [{:method "wakuext_shareCommunityV2"
:params [{:communityId community-id
:users pks}]
:js-response true
+17 -2
View File
@@ -5,7 +5,8 @@
[utils.re-frame :as rf]))
(defn ->rpc
[{:keys [content] :as message}]
[{:keys [content]
:as message}]
(cond-> message
content
(assoc :text (:text content)
@@ -16,6 +17,18 @@
:community-id :communityId
:clock-value :clock})))
(defn- <-status-link-previews-rpc
[preview]
(-> preview
(update :community
set/rename-keys
{:communityId :community-id
:displayName :display-name
:membersCount :members-count
:activeMembersCount :active-members-count})
(update-in [:community :banner] set/rename-keys {:dataUri :data-uri})
(update-in [:community :icon] set/rename-keys {:dataUri :data-uri})))
(defn- <-link-preview-rpc
[preview]
(update preview :thumbnail set/rename-keys {:dataUri :data-uri}))
@@ -53,8 +66,10 @@
:new :new?
:albumImagesCount :album-images-count
:displayName :display-name
:linkPreviews :link-previews})
:linkPreviews :link-previews
:statusLinkPreviews :status-link-previews})
(update :link-previews #(map <-link-preview-rpc %))
(update :status-link-previews #(map <-status-link-previews-rpc %))
(update :quoted-message
set/rename-keys
{:parsedText :parsed-text
+1
View File
@@ -104,6 +104,7 @@
;;; Link previews
(reg-root-key-sub :link-previews-whitelist :link-previews-whitelist)
(reg-root-key-sub :chat/link-previews :chat/link-previews)
(reg-root-key-sub :chat/status-link-previews :chat/status-link-previews)
;;commands
(reg-root-key-sub :commands/select-account :commands/select-account)
+32 -15
View File
@@ -5,32 +5,49 @@
[taoensso.timbre :as log]
[utils.re-frame :as rf]))
(defn- image->rpc [image] (set/rename-keys image {:data-uri :dataUri}))
(defn- link-preview->rpc
[preview]
(update preview
:thumbnail
(fn [thumbnail]
(set/rename-keys thumbnail {:data-uri :dataUri}))))
(image->rpc thumbnail))))
(defn- status-link-preview->rpc
[preview]
(update preview
:community
(fn [community]
(-> community
(set/rename-keys {:community-id :communityId
:display-name :displayName
:members-count :membersCount
:active-members-count :activeMembersCount})
(update :banner image->rpc)
(update :icon image->rpc)))))
(defn build-message
[msg]
(-> msg
(update :link-previews #(map link-preview->rpc %))
(update :status-link-previews #(set (map status-link-preview->rpc %)))
(set/rename-keys
{:album-id :albumId
:audio-duration-ms :audioDurationMs
:audio-path :audioPath
:chat-id :chatId
:community-id :communityId
:content-type :contentType
:ens-name :ensName
:image-height :imageHeight
:image-path :imagePath
:image-width :imageWidth
:link-previews :linkPreviews
:response-to :responseTo
:sticker :sticker
:text :text})))
{:album-id :albumId
:audio-duration-ms :audioDurationMs
:audio-path :audioPath
:chat-id :chatId
:community-id :communityId
:content-type :contentType
:ens-name :ensName
:image-height :imageHeight
:image-path :imagePath
:image-width :imageWidth
:link-previews :linkPreviews
:status-link-previews :statusLinkPreviews
:response-to :responseTo
:sticker :sticker
:text :text})))
(rf/defn send-chat-messages
[_ messages]
@@ -35,25 +35,29 @@
(let [cleared (set (get-in db [:chat/link-previews :cleared]))]
(when (or (empty? urls)
(not= (set urls) cleared))
(let [cache (get-in db [:chat/link-previews :cache])
previews (urls->previews cache urls)
new-urls (->> previews
(filter :loading?)
(map :url))
(let [cache (get-in db [:chat/link-previews :cache])
previews (urls->previews cache urls)
new-urls (->> previews
(filter :loading?)
(map :url))
status-link-preview? #(string/includes? % "status.app")
status-link-urls (->> urls
(filter status-link-preview?))
;; `request-id` is a must because we need to process only the last
;; unfurling event, as well as avoid needlessly updating the app db
;; if the user changes the URLs in the input text when there are
;; in-flight RPC requests.
request-id (new-request-id)]
request-id
(new-request-id)]
(merge {:db (-> db
(assoc-in [:chat/link-previews :unfurled] previews)
(assoc-in [:chat/link-previews :request-id] request-id)
(update :chat/link-previews dissoc :cleared))}
(when (seq new-urls)
(when (or (seq status-link-urls) (seq new-urls))
(log/debug "Unfurling URLs" {:urls new-urls :request-id request-id})
{:json-rpc/call
[{:method "wakuext_unfurlURLs"
:params [new-urls]
:params [(concat new-urls status-link-urls)]
:on-success #(rf/dispatch [:link-preview/unfurl-parsed-urls-success request-id %])
:on-error #(rf/dispatch [:link-preview/unfurl-parsed-urls-error request-id
%])}]}))))))
@@ -82,17 +86,22 @@
(rf/defn unfurl-parsed-urls-success
{:events [:link-preview/unfurl-parsed-urls-success]}
[{:keys [db]} request-id {new-previews :linkPreviews}]
(when (= request-id (get-in db [:chat/link-previews :request-id]))
(let [new-previews (map data-store.messages/<-link-preview-rpc new-previews)
curr-previews (get-in db [:chat/link-previews :unfurled])
indexed-new-previews (utils.collection/index-by :url new-previews)]
[{:keys [db]} request-id {new-previews :linkPreviews status-link-previews :statusLinkPreviews}]
(when (or (seq status-link-previews) (= request-id (get-in db [:chat/link-previews :request-id])))
(let [new-previews (map data-store.messages/<-link-preview-rpc new-previews)
status-link-previews (map data-store.messages/<-status-link-previews-rpc
status-link-previews)
curr-previews (get-in db [:chat/link-previews :unfurled])
indexed-new-previews (utils.collection/index-by :url new-previews)
indexed-status-link-previews (utils.collection/index-by :url status-link-previews)]
(log/debug "URLs unfurled"
{:event :link-preview/unfurl-parsed-urls-success
:previews (map #(update % :thumbnail dissoc :data-uri) new-previews)
:request-id request-id})
{:db (-> db
(update-in [:chat/link-previews :unfurled] reconcile-unfurled indexed-new-previews)
(assoc-in [:chat/status-link-previews :unfurled]
status-link-previews)
(update-in [:chat/link-previews :cache]
merge
indexed-new-previews
@@ -130,3 +139,12 @@
{:db (-> db
(update :chat/link-previews dissoc :unfurled :request-id)
(assoc-in [:chat/link-previews :cleared] unfurled-urls))}))
(rf/defn clear-status-link-previews
{:events [:status-link-preview/clear]}
[{:keys [db]}]
(let [unfurled-urls (set (map :url (get-in db [:chat/status-link-previews :unfurled])))]
{:db (-> db
(update :chat/status-link-previews dissoc :unfurled)
(assoc-in [:chat/status-link-previews :cleared] unfurled-urls))}))
@@ -20,26 +20,37 @@
(defn f-view
[]
(let [previews (rf/sub [:chats/link-previews-unfurled])
height (use-animated-height (boolean (seq previews)))]
(let [previews (rf/sub [:chats/link-previews-unfurled])
status-link-previews (rf/sub [:chats/status-link-previews-unfurled])
height (use-animated-height (boolean (or (seq status-link-previews)
(seq previews))))]
[reanimated/view
{:style (reanimated/apply-animations-to-style {:height height} {:z-index 1})}
[quo/url-preview-list
{:key-fn :url
:preview-width (- (:width (rn/get-window))
(* 2 style/padding-horizontal))
:container-style (when (seq previews) style/preview-list)
:container-style (when (or (seq status-link-previews) (seq previews)) style/preview-list)
:container-style-item {:height style/preview-height}
:horizontal-spacing style/padding-horizontal
:loading-message (i18n/label :t/link-preview-loading-message)
:on-clear #(rf/dispatch [:link-preview/clear])
:data (map (fn [{:keys [title thumbnail hostname loading? url]}]
{:title title
:body hostname
:loading? loading?
:thumbnail (:data-uri thumbnail)
:url url})
previews)}]]))
:on-clear #(do
(rf/dispatch [:status-link-preview/clear])
(rf/dispatch [:link-preview/clear]))
:data (map (fn [{:keys [title thumbnail hostname loading? url community]}]
(if (seq community)
(let [{:keys [display-name banner]} community]
{:title display-name
:body "status.app"
:loading? loading?
:thumbnail (:data-uri banner)
:url url})
{:title title
:body hostname
:loading? loading?
:thumbnail (:data-uri thumbnail)
:url url}))
(set (concat previews status-link-previews)))}]]))
(defn view
[]
@@ -13,15 +13,32 @@
(defn view
[{:keys [chat-id message-id]}]
(let [previews (rf/sub [:chats/message-link-previews chat-id message-id])]
(when (seq previews)
(let [previews (rf/sub [:chats/message-link-previews chat-id message-id])
status-link-previews (rf/sub [:chats/message-status-link-previews chat-id message-id])]
(when (or (seq status-link-previews)
(seq previews))
[:<>
(for [{:keys [url title description thumbnail hostname]} previews]
(for [{:keys [url title description thumbnail hostname community]}
(concat status-link-previews previews)]
^{:key url}
[quo/link-preview
{:title title
:description description
:link hostname
:thumbnail (:url thumbnail)
:thumbnail-size (when (nearly-square? thumbnail) :large)
:container-style {:margin-top 8}}])])))
(if community
(let [{community-description :description
community-icon :icon
community-banner :banner
community-name :display-name
members-count :members-count} community]
[quo/status-link-preview-community
{:description community-description
:members-count members-count
:title community-name
:banner (:url community-banner)
:icon (:url community-icon)
:link url
:on-press #(rf/dispatch [:universal-links/handle-url url])}])
[quo/link-preview
{:title title
:description description
:link hostname
:thumbnail (:url thumbnail)
:thumbnail-size (when (nearly-square? thumbnail) :large)
:container-style {:margin-top 8}}]))])))
@@ -145,6 +145,7 @@
[status-im2.contexts.quo-preview.settings.settings-item :as settings-item]
[status-im2.contexts.quo-preview.share.qr-code :as qr-code]
[status-im2.contexts.quo-preview.share.share-qr-code :as share-qr-code]
[status-im2.contexts.quo-preview.status-link-preview.community :as status-preview-community]
[status-im2.contexts.quo-preview.style :as style]
[status-im2.contexts.quo-preview.switcher.group-messaging-card :as group-messaging-card]
[status-im2.contexts.quo-preview.switcher.switcher-cards :as switcher-cards]
@@ -324,7 +325,10 @@
:component url-preview-list/view}
{:name :link-preview
:options {:insets {:top? true}}
:component link-preview/view}]
:component link-preview/view}
{:name :status-preview-community
:options {:insets {:top true}}
:component status-preview-community/view}]
:list-items [{:name :account
:component account-item/view}
{:name :account-list-card
@@ -0,0 +1,37 @@
(ns status-im2.contexts.quo-preview.status-link-preview.community
(:require
[quo.core :as quo]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]))
(def descriptor
[{:type :text :key :title}
{:type :text :key :description}
{:type :boolean :key :loading?}
{:type :text :key :members-count}
{:type :text :key :active-members-count}])
(defn view
[]
(let [state (reagent/atom
{:title "Doodles"
:description "Coloring the world with joy • ᴗ •"
:members-count 24
:active-members-count 12
:link "https://status.app/community-link"
:loading? false})]
(fn []
[preview/preview-container
{:state state
:descriptor descriptor}
[quo/status-link-preview-community
{:title (:title @state)
:description (:description @state)
:icon (resources/get-mock-image :status-logo)
:banner (resources/get-mock-image :status-logo)
:loading? (:loading? @state)
:members-count (int (:members-count @state))
:loading-message (:loading-message @state)
:active-members-count (int (:active-members-count @state))
:on-clear #(js/alert "Clear button pressed")}]])))
+10 -2
View File
@@ -442,11 +442,19 @@
(fn [previews]
(get previews :unfurled)))
(re-frame/reg-sub
:chats/status-link-previews-unfurled
:<- [:chat/status-link-previews]
(fn [previews]
(get previews :unfurled)))
(re-frame/reg-sub
:chats/link-previews?
:<- [:chats/link-previews-unfurled]
(fn [previews]
(boolean (seq previews))))
:<- [:chats/status-link-previews-unfurled]
(fn [previews status-link-previews]
(or (boolean (seq status-link-previews))
(boolean (seq previews)))))
(re-frame/reg-sub
:chat/check-channel-muted?
+6
View File
@@ -152,6 +152,12 @@
(fn [messages [_ chat-id message-id]]
(get-in messages [chat-id message-id :link-previews])))
(re-frame/reg-sub
:chats/message-status-link-previews
:<- [:messages/messages]
(fn [messages [_ chat-id message-id]]
(get-in messages [chat-id message-id :status-link-previews])))
(re-frame/reg-sub
:chats/pinned
:<- [:messages/pin-messages]
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.171.27",
"commit-sha1": "76b6745666b945f8d6336e2a5fc6e5705985273d",
"src-sha256": "1amak99bpsx6j8grzm2kzwd3si34gg4r8kbxqmnkfsrkm2nzvbx1"
"version": "status-mobile-17116",
"commit-sha1": "cfd85f8b2c5f0c094ea7451acd4b2ed3232cb97e",
"src-sha256": "15x8ynbqx2sk19hkyy8x45hglf99c0x7vm3lpik0aw5d8i5zcgvm"
}