remove unused use-status-go-protocol? flag and code

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-09-15 21:30:38 +02:00
parent 543d28fbc1
commit e87d75039e
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
3 changed files with 23 additions and 57 deletions

View File

@ -108,14 +108,6 @@
(fx/defn add-public-chat (fx/defn add-public-chat
"Adds new public group chat to db" "Adds new public group chat to db"
[cofx topic] [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 (upsert-chat cofx
{:chat-id topic {:chat-id topic
:is-active true :is-active true
@ -125,7 +117,7 @@
:public? true :public? true
:might-have-join-time-messages? true :might-have-join-time-messages? true
:unviewed-messages-count 0 :unviewed-messages-count 0
:loaded-unviewed-messages-ids #{}}))) :loaded-unviewed-messages-ids #{}}))
(fx/defn clear-history (fx/defn clear-history
"Clears history of the particular chat" "Clears history of the particular chat"
@ -163,17 +155,6 @@
(fx/defn remove-chat (fx/defn remove-chat
"Removes chat completely from app, producing all necessary effects for that" "Removes chat completely from app, producing all necessary effects for that"
[{:keys [db now] :as cofx} chat-id] [{: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 (fx/merge cofx
(mailserver/remove-gaps chat-id) (mailserver/remove-gaps chat-id)
(mailserver/remove-range chat-id) (mailserver/remove-range chat-id)
@ -181,7 +162,7 @@
(clear-history chat-id) (clear-history chat-id)
(transport.filters/stop-listening chat-id) (transport.filters/stop-listening chat-id)
(when (not (= (:view-id db) :home)) (when (not (= (:view-id db) :home))
(navigation/navigate-to-cofx :home {}))))) (navigation/navigate-to-cofx :home {}))))
(defn- unread-messages-number [chats] (defn- unread-messages-number [chats]
(apply + (map :unviewed-messages-count chats))) (apply + (map :unviewed-messages-count chats)))
@ -266,21 +247,11 @@
[{:keys [db] :as cofx} chat-id opts] [{:keys [db] :as cofx} chat-id opts]
;; don't allow to open chat with yourself ;; don't allow to open chat with yourself
(when (not= (multiaccounts.model/current-public-key cofx) chat-id) (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 (fx/merge cofx
(upsert-chat {:chat-id chat-id (upsert-chat {:chat-id chat-id
:is-active true}) :is-active true})
(transport.filters/load-chat chat-id) (transport.filters/load-chat chat-id)
(navigate-to-chat chat-id opts))))) (navigate-to-chat chat-id opts))))
(fx/defn start-public-chat (fx/defn start-public-chat
"Starts a new public chat" "Starts a new public chat"

View File

@ -55,10 +55,7 @@
;;TODO not used anywhere? ;;TODO not used anywhere?
"shhext_deleteChat" {} "shhext_deleteChat" {}
"shhext_saveContact" {} "shhext_saveContact" {}
"status_joinPublicChat" {}
"status_chats" {} "status_chats" {}
"status_startOneOnOneChat" {}
"status_removeChat" {}
"wallet_getTransfers" {} "wallet_getTransfers" {}
"wallet_getTokensBalances" {} "wallet_getTokensBalances" {}
"browsers_getBrowsers" {} "browsers_getBrowsers" {}

View File

@ -32,8 +32,6 @@
(def contract-nodes-enabled? (enabled? (get-config :CONTRACT_NODES "0"))) (def contract-nodes-enabled? (enabled? (get-config :CONTRACT_NODES "0")))
(def mobile-ui-for-desktop? (enabled? (get-config :MOBILE_UI_FOR_DESKTOP "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 ;; CONFIG VALUES
(def log-level (def log-level
(-> (get-config :LOG_LEVEL "error") (-> (get-config :LOG_LEVEL "error")