From e87d75039ead5a1baf77daeb657be489d442644a Mon Sep 17 00:00:00 2001 From: yenda Date: Sun, 15 Sep 2019 21:30:38 +0200 Subject: [PATCH] remove unused use-status-go-protocol? flag and code Signed-off-by: yenda --- src/status_im/chat/models.cljs | 75 +++++++++------------------- src/status_im/ethereum/json_rpc.cljs | 3 -- src/status_im/utils/config.cljs | 2 - 3 files changed, 23 insertions(+), 57 deletions(-) diff --git a/src/status_im/chat/models.cljs b/src/status_im/chat/models.cljs index a9a3865621..f9a995e5a1 100644 --- a/src/status_im/chat/models.cljs +++ b/src/status_im/chat/models.cljs @@ -108,24 +108,16 @@ (fx/defn add-public-chat "Adds new public group chat to db" [cofx topic] - (if config/use-status-go-protocol? - {::json-rpc/call [{:method "status_joinPublicChat" - :params [topic] - :on-success - #(log/debug "successfully joined a public chat:" topic) - :on-error - (fn [error] - (log/error "can't join a public chat:" error))}]} - (upsert-chat cofx - {:chat-id topic - :is-active true - :name topic - :group-chat true - :contacts #{} - :public? true - :might-have-join-time-messages? true - :unviewed-messages-count 0 - :loaded-unviewed-messages-ids #{}}))) + (upsert-chat cofx + {:chat-id topic + :is-active true + :name topic + :group-chat true + :contacts #{} + :public? true + :might-have-join-time-messages? true + :unviewed-messages-count 0 + :loaded-unviewed-messages-ids #{}})) (fx/defn clear-history "Clears history of the particular chat" @@ -163,25 +155,14 @@ (fx/defn remove-chat "Removes chat completely from app, producing all necessary effects for that" [{:keys [db now] :as cofx} chat-id] - (if config/use-status-go-protocol? - (fx/merge cofx - {::json-rpc/call [{:method "status_removeChat" - :params [chat-id] - :on-success - #(log/debug "successfully removed a chat:" chat-id) - :on-error - (fn [error] - (log/error "can't remove a chat:" error))}]} - (when (not (= (:view-id db) :home)) - (navigation/navigate-to-cofx :home {}))) - (fx/merge cofx - (mailserver/remove-gaps chat-id) - (mailserver/remove-range chat-id) - (deactivate-chat chat-id) - (clear-history chat-id) - (transport.filters/stop-listening chat-id) - (when (not (= (:view-id db) :home)) - (navigation/navigate-to-cofx :home {}))))) + (fx/merge cofx + (mailserver/remove-gaps chat-id) + (mailserver/remove-range chat-id) + (deactivate-chat chat-id) + (clear-history chat-id) + (transport.filters/stop-listening chat-id) + (when (not (= (:view-id db) :home)) + (navigation/navigate-to-cofx :home {})))) (defn- unread-messages-number [chats] (apply + (map :unviewed-messages-count chats))) @@ -266,21 +247,11 @@ [{:keys [db] :as cofx} chat-id opts] ;; don't allow to open chat with yourself (when (not= (multiaccounts.model/current-public-key cofx) chat-id) - (if config/use-status-go-protocol? - (fx/merge cofx - {::json-rpc/call [{:method "status_startOneOnOneChat" - :params [chat-id] - :on-success - #(log/debug "successfully started a 1-1 chat with:" chat-id) - :on-error - (fn [error] - (log/error "can't start a 1-1 chat:" error))}]} - (navigate-to-chat chat-id opts)) - (fx/merge cofx - (upsert-chat {:chat-id chat-id - :is-active true}) - (transport.filters/load-chat chat-id) - (navigate-to-chat chat-id opts))))) + (fx/merge cofx + (upsert-chat {:chat-id chat-id + :is-active true}) + (transport.filters/load-chat chat-id) + (navigate-to-chat chat-id opts)))) (fx/defn start-public-chat "Starts a new public chat" diff --git a/src/status_im/ethereum/json_rpc.cljs b/src/status_im/ethereum/json_rpc.cljs index d5f6dec89d..8d0e32276a 100644 --- a/src/status_im/ethereum/json_rpc.cljs +++ b/src/status_im/ethereum/json_rpc.cljs @@ -55,10 +55,7 @@ ;;TODO not used anywhere? "shhext_deleteChat" {} "shhext_saveContact" {} - "status_joinPublicChat" {} "status_chats" {} - "status_startOneOnOneChat" {} - "status_removeChat" {} "wallet_getTransfers" {} "wallet_getTokensBalances" {} "browsers_getBrowsers" {} diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index e97e839e98..c48900ad09 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -32,8 +32,6 @@ (def contract-nodes-enabled? (enabled? (get-config :CONTRACT_NODES "0"))) (def mobile-ui-for-desktop? (enabled? (get-config :MOBILE_UI_FOR_DESKTOP "0"))) -(def use-status-go-protocol? (enabled? (get-config :STATUS_GO_PROTOCOL "0"))) - ;; CONFIG VALUES (def log-level (-> (get-config :LOG_LEVEL "error")