diff --git a/src/status_im/chat/models.cljs b/src/status_im/chat/models.cljs index d7d5429dd0..0b8bda52e1 100644 --- a/src/status_im/chat/models.cljs +++ b/src/status_im/chat/models.cljs @@ -48,7 +48,7 @@ (defn active-chat? [cofx chat-id] (let [chat (get-chat cofx chat-id)] - (not (nil? chat)))) + (:active chat))) (defn foreground-chat? [{{:keys [current-chat-id view-id]} :db} chat-id] @@ -115,11 +115,11 @@ "Add chats to db and update" [{:keys [db] :as cofx} chats] (let [{:keys [all-chats chats-home-list removed-chats]} - (reduce (fn [acc {:keys [chat-id profile-public-key timeline? community-id active] :as chat}] - (if (not active) + (reduce (fn [acc {:keys [chat-id profile-public-key timeline? community-id active muted] :as chat}] + (if (not (or active muted)) (update acc :removed-chats conj chat-id) (cond-> acc - (and (not profile-public-key) (not timeline?) (not community-id)) + (and (not profile-public-key) (not timeline?) (not community-id) active) (update :chats-home-list conj chat-id) :always (assoc-in [:all-chats chat-id] chat)))) @@ -177,8 +177,9 @@ [{:keys [db now] :as cofx} chat-id] (fx/merge cofx - {:db (-> db - (update :chats dissoc chat-id) + {:db (-> (if (get-in db [:chats chat-id :muted]) + (assoc-in db [:chats chat-id :active] false) + (update db :chats dissoc chat-id)) (update :chats-home-list disj chat-id) (assoc-in [:current-chat-id] nil)) ::json-rpc/call [{:method "wakuext_deactivateChat" diff --git a/src/status_im/chat/models/loading.cljs b/src/status_im/chat/models/loading.cljs index 8b76bb5ae4..a81f9eeff7 100644 --- a/src/status_im/chat/models/loading.cljs +++ b/src/status_im/chat/models/loading.cljs @@ -23,10 +23,10 @@ [{:keys [db]} ^js new-chats-js] (let [{:keys [all-chats chats-home-list]} (reduce (fn [acc ^js chat-js] - (let [{:keys [chat-id profile-public-key timeline? community-id] :as chat} + (let [{:keys [chat-id profile-public-key timeline? community-id active] :as chat} (data-store.chats/<-rpc-js chat-js)] (cond-> acc - (and (not profile-public-key) (not timeline?) (not community-id)) + (and (not profile-public-key) (not timeline?) (not community-id) active) (update :chats-home-list conj chat-id) :always (assoc-in [:all-chats chat-id] chat)))) diff --git a/src/status_im/data_store/chats.cljs b/src/status_im/data_store/chats.cljs index ab928dea29..465c38d8dc 100644 --- a/src/status_im/data_store/chats.cljs +++ b/src/status_im/data_store/chats.cljs @@ -97,7 +97,8 @@ :community-id (.-contentCommunityId chat)} :last-clock-value (.-lastClockValue chat) :profile-public-key (.-profile chat) - :highlight (.-highlight chat)} + :highlight (.-highlight chat) + :active (.-active chat)} rpc->type unmarshal-members)) diff --git a/status-go-version.json b/status-go-version.json index 55fbcfa685..253a724c1a 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.97.3", - "commit-sha1": "331cf1e40188553b508e81193d42e0eee6d6a8c8", - "src-sha256": "1yl7arvi6jlb591g6l2c4y41l5aqpvxcwl14iw73rp4qy4wvvcbz" + "version": "v0.97.4", + "commit-sha1": "724689086cdd3edef71a31c17e8888b1933c9ea5", + "src-sha256": "091fc4ql9mp99ljw3l644bvkmwrfj2sq2mdhkwz6bn3z2maxgalk" }