Identify New Chats (#12654)

This commit is contained in:
Parvesh Monu 2021-10-22 14:48:58 +05:30 committed by GitHub
parent 45c1896717
commit 7d6bee9099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 15 deletions

View File

@ -61,7 +61,8 @@
[db chat-id]
(update-in db [:chats chat-id] assoc
:unviewed-messages-count 0
:unviewed-mentions-count 0))
:unviewed-mentions-count 0
:highlight false))
(fx/defn handle-mark-all-read-successful
{:events [::mark-all-read-successful]}

View File

@ -93,9 +93,11 @@
:unviewed-mentions-count (.-unviewedMentionsCount chat)
:last-message {:content {:text (.-text 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)
:profile-public-key (.-profile chat)}
:profile-public-key (.-profile chat)
:highlight (.-highlight chat)}
rpc->type
unmarshal-members))

View File

@ -162,7 +162,7 @@
[sheets/actions home-item])}])}])
(defn categories-accordion [community-id chats categories edit data]
[rn/view {:padding-bottom 8}
[:<>
(for [{:keys [name id]} (vals categories)]
^{:key (str "cat" name id)}
[:<>

View File

@ -14,10 +14,11 @@
[status-im.utils.datetime :as time]
[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
:accessibility-label :no-messages-text}
(i18n/label label-key)])
:accessibility-label :no-messages-text
:number-of-lines 1}
(i18n/label label-key label-fn)])
(def max-subheader-length 100)
@ -70,7 +71,11 @@
parsed-text)]
(: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})
(cond
(not (and content content-type))
@ -95,7 +100,12 @@
[preview-label :t/image]
(= 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
(memoize
@ -154,8 +164,9 @@
(first @(re-frame/subscribe [:contacts/contact-two-names-by-identity chat-id])))])
(defn home-list-item [home-item opts]
(let [{:keys [chat-id chat-name color group-chat public? timestamp last-message muted emoji]} home-item]
[react/touchable-opacity (merge {:style {:height 64}} opts)
(let [{:keys [chat-id chat-name color group-chat public? timestamp last-message muted emoji highlight]} home-item
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-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))
(:whisper-timestamp last-message)
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]]]))

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.89.13",
"commit-sha1": "b79d68c69684f754ea705469c552485905f58e32",
"src-sha256": "10h2y9kyahpfns4kfjqzayqfb7fwq94lmncp47snbcrwj03vaanq"
"version": "v0.89.14",
"commit-sha1": "c20e8ebdeffd14a881d8092ee64e5180ad53449e",
"src-sha256": "0jbmgj0m1hv1nx3frbzs7lsn8nqspsir5kpzn8lldfgkfgpv96h7"
}