Skip to content

Commit 5795ca8

Browse files
committed
Enable group chats
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
1 parent 8345a0e commit 5795ca8

11 files changed

Lines changed: 15 additions & 14 deletions

File tree

.env.e2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ POW_TIME=1
88
DEFAULT_NETWORK=testnet_rpc
99
DEBUG_WEBVIEW=1
1010
GROUP_CHATS_ENABLED=1
11+
PAIRING_ENABLED=1
1112
EXTENSIONS=1
1213
PFS_ENCRYPTION_ENABLED=0
1314
ERC20_CONTRACT_WARNINGS=1

.env.nightly.staging.fleet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ POW_TARGET=0.002
77
POW_TIME=1
88
DEFAULT_NETWORK=mainnet_rpc
99
DEBUG_WEBVIEW=1
10-
GROUP_CHATS_ENABLED=0
10+
PAIRING_ENABLED=1
11+
GROUP_CHATS_ENABLED=1
1112
MAINNET_WARNING_ENABLED=1
1213
EXTENSIONS=1
1314
PFS_ENCRYPTION_ENABLED=0

.env.prod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ POW_TARGET=0.002
99
POW_TIME=1
1010
DEFAULT_NETWORK=mainnet_rpc
1111
DEBUG_WEBVIEW=0
12-
GROUP_CHATS_ENABLED=0
12+
GROUP_CHATS_ENABLED=1
13+
PAIRING_ENABLED=1
1314
MAINNET_WARNING_ENABLED=1
1415
EXTENSIONS=1
1516
PFS_ENCRYPTION_ENABLED=0

src/status_im/chat/db.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
;; not a group chat
2626
(or (not (and group-chat (not public?)))
2727
;; if it's a group chat
28-
(utils.config/group-chats-enabled? dev-mode?)))
28+
utils.config/group-chats-enabled?))
2929
(assoc acc chat-id (if-let [contact (get contacts chat-id)]
3030
(-> chat
3131
(assoc :name (:name contact))

src/status_im/group_chats/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
membership-updates] :as membership-update}
382382
sender-signature]
383383
(let [dev-mode? (get-in cofx [:db :account/account :dev-mode?])]
384-
(when (and (config/group-chats-enabled? dev-mode?)
384+
(when (and config/group-chats-enabled?
385385
(valid-chat-id? chat-id (extract-creator membership-update)))
386386
(let [previous-chat (get-in cofx [:db :chats chat-id])
387387
all-updates (clojure.set/union (set (:membership-updates previous-chat))

src/status_im/node/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
;; We don't check dev-mode? here as
111111
;; otherwise we would have to restart the node
112112
;; when the user enables it
113-
(config/group-chats-enabled? true)
113+
config/group-chats-enabled?
114114
(config/pairing-enabled? true)))
115115

116116
(and

src/status_im/ui/screens/add_new/views.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
:on-press #(re-frame/dispatch [:navigate-to :new-chat])}]
2424
[action-button/action-separator]
2525
;; Hide behind flag (false by default), till everything is fixed in group chats
26-
(when (config/group-chats-enabled? dev-mode?)
26+
(when config/group-chats-enabled?
2727
[action-button/action-button
2828
{:label (i18n/label :t/start-group-chat)
2929
:accessibility-label :start-group-chat-button
3030
:icon :icons/contacts
3131
:icon-opts {:color colors/blue}
3232
:on-press #(re-frame/dispatch [:contact.ui/start-group-chat-pressed])}])
33-
(when (config/group-chats-enabled? dev-mode?)
33+
(when config/group-chats-enabled?
3434
[action-button/action-separator])
3535
[action-button/action-button
3636
{:label (i18n/label :t/new-public-group-chat)

src/status_im/ui/screens/desktop/main/add_new/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
[react/image {:style styles/suggested-contact-image
9393
:source {:uri (:photo-path c)}}]
9494
[react/text {:style styles/new-contact-subtitle} (:name c)]]]))]]
95-
(when (config/group-chats-enabled? true) group-chat-section)
95+
(when config/group-chats-enabled? group-chat-section)
9696
^{:key "publicchat"}
9797
[react/view {:style styles/new-contact-title}
9898
[react/text {:style styles/new-contact-title-text

src/status_im/utils/config.cljs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
(def bootnodes-settings-enabled? (enabled? (get-config :BOOTNODES_SETTINGS_ENABLED "1")))
1919
(def rpc-networks-only? (enabled? (get-config :RPC_NETWORKS_ONLY "1")))
20-
(defn group-chats-enabled? [dev-mode?]
21-
(and (enabled? (get-config :GROUP_CHATS_ENABLED "0"))
22-
(or dev-mode? platform/desktop?)))
20+
(def group-chats-enabled? (enabled? (get-config :GROUP_CHATS_ENABLED "0")))
2321
(defn pairing-enabled? [dev-mode?]
2422
(and (enabled? (get-config :PAIRING_ENABLED "0"))
2523
(or dev-mode? platform/desktop?)))

test/cljs/status_im/test/group_chats/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
(is (= 3 (group-chats/get-last-clock-value {:db {:chats {chat-id {:last-clock-value 3}}}} chat-id))))
3030

3131
(deftest handle-group-membership-update-test
32-
(with-redefs [config/group-chats-enabled? (constantly true)]
32+
(with-redefs [config/group-chats-enabled? true]
3333
(testing "a brand new chat"
3434
(let [actual (->
3535
(group-chats/handle-membership-update {:now 0 :db {}} initial-message admin)

0 commit comments

Comments
 (0)