Skip to content

Commit

Permalink
don't unmute contact while adding
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Mar 30, 2022
1 parent c40094f commit 67fd667
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/status_im/chat/models.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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))))
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/status_im/chat/models/loading.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/data_store/chats.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.97.3",
"commit-sha1": "331cf1e40188553b508e81193d42e0eee6d6a8c8",
"src-sha256": "1yl7arvi6jlb591g6l2c4y41l5aqpvxcwl14iw73rp4qy4wvvcbz"
"version": "fix/return-muted-chats",
"commit-sha1": "a2c13cffe0305c4b9ff54c079c7a9e061800e843",
"src-sha256": "04kbrkp207ls98nrvinpjcgj50bv31vzhvcfxpyaiqz7sa5zspyj"
}

0 comments on commit 67fd667

Please sign in to comment.