mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
remove unused use-status-go-protocol? flag and code
Signed-off-by: yenda <eric@status.im>
This commit is contained in:
parent
543d28fbc1
commit
e87d75039e
@ -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"
|
||||
|
@ -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" {}
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user