Remove message data remnants

This commit is contained in:
janherich 2018-01-05 16:22:57 +01:00
parent 9f9d788e2c
commit 4ce70f86fb
No known key found for this signature in database
GPG Key ID: C23B473AFBE94D13
2 changed files with 10 additions and 15 deletions

View File

@ -9,7 +9,7 @@
(not= (str/index-of name text) nil)))
(reg-sub :filtered-chats
:<- [:get :chats]
:<- [:chats]
:<- [:get-in [:toolbar-search :text]]
:<- [:get-in [:toolbar-search :show]]
(fn [[chats search-text show-search]]

View File

@ -54,20 +54,15 @@
content])])}))
(defview message-status [{:keys [chat-id contacts]}
{:keys [message-id message-status user-statuses message-type outgoing] :as msg}]
(letsubs [app-db-message-status-value [:get-in [:message-data :statuses message-id :status]]]
(let [delivery-status (get-in user-statuses [chat-id :status])]
(when (and outgoing
(or (some #(= (keyword %) :seen) [delivery-status
message-status
app-db-message-status-value])
(and (= (keyword message-type) :group-user-message)
(and (= (count user-statuses) (count contacts))
(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}]))))
{:keys [message-id user-statuses outgoing] :as msg}]
(letsubs [current-public-key [:get-current-public-key]]
(let [delivery-statuses (dissoc user-statuses current-public-key)
seen-by-everyone (and (= (count delivery-statuses) (count contacts)
(every? (comp (partial = :seen) second)
delivery-statuses)))]
(when (and outgoing (or (= chat-id const/console-chat-id)
seen-by-everyone))
[vi/icon :icons/ok {:style st/status-image}]))))
(defn message-timestamp [{:keys [timestamp]}]
(when timestamp