Remove message data remnants
This commit is contained in:
parent
9f9d788e2c
commit
4ce70f86fb
|
@ -9,7 +9,7 @@
|
||||||
(not= (str/index-of name text) nil)))
|
(not= (str/index-of name text) nil)))
|
||||||
|
|
||||||
(reg-sub :filtered-chats
|
(reg-sub :filtered-chats
|
||||||
:<- [:get :chats]
|
:<- [:chats]
|
||||||
:<- [:get-in [:toolbar-search :text]]
|
:<- [:get-in [:toolbar-search :text]]
|
||||||
:<- [:get-in [:toolbar-search :show]]
|
:<- [:get-in [:toolbar-search :show]]
|
||||||
(fn [[chats search-text show-search]]
|
(fn [[chats search-text show-search]]
|
||||||
|
|
|
@ -54,20 +54,15 @@
|
||||||
content])])}))
|
content])])}))
|
||||||
|
|
||||||
(defview message-status [{:keys [chat-id contacts]}
|
(defview message-status [{:keys [chat-id contacts]}
|
||||||
{:keys [message-id message-status user-statuses message-type outgoing] :as msg}]
|
{:keys [message-id user-statuses outgoing] :as msg}]
|
||||||
(letsubs [app-db-message-status-value [:get-in [:message-data :statuses message-id :status]]]
|
(letsubs [current-public-key [:get-current-public-key]]
|
||||||
(let [delivery-status (get-in user-statuses [chat-id :status])]
|
(let [delivery-statuses (dissoc user-statuses current-public-key)
|
||||||
(when (and outgoing
|
seen-by-everyone (and (= (count delivery-statuses) (count contacts)
|
||||||
(or (some #(= (keyword %) :seen) [delivery-status
|
(every? (comp (partial = :seen) second)
|
||||||
message-status
|
delivery-statuses)))]
|
||||||
app-db-message-status-value])
|
(when (and outgoing (or (= chat-id const/console-chat-id)
|
||||||
(and (= (keyword message-type) :group-user-message)
|
seen-by-everyone))
|
||||||
(and (= (count user-statuses) (count contacts))
|
[vi/icon :icons/ok {:style st/status-image}]))))
|
||||||
(every? (fn [[_ {:keys [status]}]]
|
|
||||||
(= (keyword status) :seen)) user-statuses)))
|
|
||||||
(= chat-id const/console-chat-id)))
|
|
||||||
[react/image {:source {:uri :icon_ok_small}
|
|
||||||
:style st/status-image}]))))
|
|
||||||
|
|
||||||
(defn message-timestamp [{:keys [timestamp]}]
|
(defn message-timestamp [{:keys [timestamp]}]
|
||||||
(when timestamp
|
(when timestamp
|
||||||
|
|
Loading…
Reference in New Issue