Identify New Chats (#12654)
This commit is contained in:
parent
45c1896717
commit
7d6bee9099
|
@ -61,7 +61,8 @@
|
||||||
[db chat-id]
|
[db chat-id]
|
||||||
(update-in db [:chats chat-id] assoc
|
(update-in db [:chats chat-id] assoc
|
||||||
:unviewed-messages-count 0
|
:unviewed-messages-count 0
|
||||||
:unviewed-mentions-count 0))
|
:unviewed-mentions-count 0
|
||||||
|
:highlight false))
|
||||||
|
|
||||||
(fx/defn handle-mark-all-read-successful
|
(fx/defn handle-mark-all-read-successful
|
||||||
{:events [::mark-all-read-successful]}
|
{:events [::mark-all-read-successful]}
|
||||||
|
|
|
@ -93,9 +93,11 @@
|
||||||
:unviewed-mentions-count (.-unviewedMentionsCount chat)
|
:unviewed-mentions-count (.-unviewedMentionsCount chat)
|
||||||
:last-message {:content {:text (.-text chat)
|
:last-message {:content {:text (.-text chat)
|
||||||
:parsed-text (types/js->clj (.-parsedText chat))}
|
:parsed-text (types/js->clj (.-parsedText chat))}
|
||||||
:content-type (.-contentType chat)}
|
:content-type (.-contentType chat)
|
||||||
|
:community-id (.-contentCommunityId chat)}
|
||||||
:last-clock-value (.-lastClockValue chat)
|
:last-clock-value (.-lastClockValue chat)
|
||||||
:profile-public-key (.-profile chat)}
|
:profile-public-key (.-profile chat)
|
||||||
|
:highlight (.-highlight chat)}
|
||||||
rpc->type
|
rpc->type
|
||||||
unmarshal-members))
|
unmarshal-members))
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
[sheets/actions home-item])}])}])
|
[sheets/actions home-item])}])}])
|
||||||
|
|
||||||
(defn categories-accordion [community-id chats categories edit data]
|
(defn categories-accordion [community-id chats categories edit data]
|
||||||
[rn/view {:padding-bottom 8}
|
[:<>
|
||||||
(for [{:keys [name id]} (vals categories)]
|
(for [{:keys [name id]} (vals categories)]
|
||||||
^{:key (str "cat" name id)}
|
^{:key (str "cat" name id)}
|
||||||
[:<>
|
[:<>
|
||||||
|
|
|
@ -14,10 +14,11 @@
|
||||||
[status-im.utils.datetime :as time]
|
[status-im.utils.datetime :as time]
|
||||||
[status-im.ui.components.chat-icon.styles :as chat-icon.styles]))
|
[status-im.ui.components.chat-icon.styles :as chat-icon.styles]))
|
||||||
|
|
||||||
(defn preview-label [label-key]
|
(defn preview-label [label-key label-fn]
|
||||||
[react/text {:style styles/last-message-text
|
[react/text {:style styles/last-message-text
|
||||||
:accessibility-label :no-messages-text}
|
:accessibility-label :no-messages-text
|
||||||
(i18n/label label-key)])
|
:number-of-lines 1}
|
||||||
|
(i18n/label label-key label-fn)])
|
||||||
|
|
||||||
(def max-subheader-length 100)
|
(def max-subheader-length 100)
|
||||||
|
|
||||||
|
@ -70,7 +71,11 @@
|
||||||
parsed-text)]
|
parsed-text)]
|
||||||
(:components result)))
|
(:components result)))
|
||||||
|
|
||||||
(defn message-content-text [{:keys [content content-type]} absolute]
|
(defn content-type-community-invite? [content-type community-id]
|
||||||
|
(and (= constants/content-type-community content-type)
|
||||||
|
(not (string/blank? community-id))))
|
||||||
|
|
||||||
|
(defn message-content-text [{:keys [content content-type community-id]} absolute]
|
||||||
[react/view (when absolute {:position :absolute :left 72 :top 32 :right 80})
|
[react/view (when absolute {:position :absolute :left 72 :top 32 :right 80})
|
||||||
(cond
|
(cond
|
||||||
(not (and content content-type))
|
(not (and content content-type))
|
||||||
|
@ -95,7 +100,12 @@
|
||||||
[preview-label :t/image]
|
[preview-label :t/image]
|
||||||
|
|
||||||
(= constants/content-type-audio content-type)
|
(= constants/content-type-audio content-type)
|
||||||
[preview-label :t/audio])])
|
[preview-label :t/audio]
|
||||||
|
|
||||||
|
(content-type-community-invite? content-type community-id)
|
||||||
|
(let [{:keys [name]}
|
||||||
|
@(re-frame/subscribe [:communities/community community-id])]
|
||||||
|
[preview-label :t/community-message-preview {:community-name name}]))])
|
||||||
|
|
||||||
(def memo-timestamp
|
(def memo-timestamp
|
||||||
(memoize
|
(memoize
|
||||||
|
@ -154,8 +164,9 @@
|
||||||
(first @(re-frame/subscribe [:contacts/contact-two-names-by-identity chat-id])))])
|
(first @(re-frame/subscribe [:contacts/contact-two-names-by-identity chat-id])))])
|
||||||
|
|
||||||
(defn home-list-item [home-item opts]
|
(defn home-list-item [home-item opts]
|
||||||
(let [{:keys [chat-id chat-name color group-chat public? timestamp last-message muted emoji]} home-item]
|
(let [{:keys [chat-id chat-name color group-chat public? timestamp last-message muted emoji highlight]} home-item
|
||||||
[react/touchable-opacity (merge {:style {:height 64}} opts)
|
background-color (when highlight (colors/get-color :interactive-02))]
|
||||||
|
[react/touchable-opacity (merge {:style {:height 64 :background-color background-color}} opts)
|
||||||
[:<>
|
[:<>
|
||||||
[chat-item-icon muted (and group-chat (not public?)) (and group-chat public?)]
|
[chat-item-icon muted (and group-chat (not public?)) (and group-chat public?)]
|
||||||
[chat-icon.screen/emoji-chat-icon-view chat-id group-chat chat-name emoji
|
[chat-icon.screen/emoji-chat-icon-view chat-id group-chat chat-name emoji
|
||||||
|
@ -175,5 +186,5 @@
|
||||||
(memo-timestamp (if (pos? (:whisper-timestamp last-message))
|
(memo-timestamp (if (pos? (:whisper-timestamp last-message))
|
||||||
(:whisper-timestamp last-message)
|
(:whisper-timestamp last-message)
|
||||||
timestamp))]
|
timestamp))]
|
||||||
[message-content-text (select-keys last-message [:content :content-type]) true]
|
[message-content-text (select-keys last-message [:content :content-type :community-id]) true]
|
||||||
[unviewed-indicator home-item]]]))
|
[unviewed-indicator home-item]]]))
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.89.13",
|
"version": "v0.89.14",
|
||||||
"commit-sha1": "b79d68c69684f754ea705469c552485905f58e32",
|
"commit-sha1": "c20e8ebdeffd14a881d8092ee64e5180ad53449e",
|
||||||
"src-sha256": "10h2y9kyahpfns4kfjqzayqfb7fwq94lmncp47snbcrwj03vaanq"
|
"src-sha256": "0jbmgj0m1hv1nx3frbzs7lsn8nqspsir5kpzn8lldfgkfgpv96h7"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue