removed messages to wallet

This commit is contained in:
Andrey Shovkoplyas 2017-10-12 14:22:17 +03:00 committed by Roman Volosovskyi
parent 8269d6d9a9
commit 6b9095d235
3 changed files with 3 additions and 19 deletions

View File

@ -82,14 +82,7 @@
(update :dispatch-n conj [:request-command-preview enriched-message])
(= (:content-type enriched-message) const/content-type-command-request)
(update :dispatch-n conj [:add-request chat-identifier enriched-message])
;; TODO(janherich) refactor this ugly special treatment of wallet send commands for logged in user
(and (= (get-in message [:content :params :bot-db :public :recipient :whisper-identity])
current-identity)
(= content-type const/content-type-command)
(not= chat-identifier const/wallet-chat-id)
(= "send" (get-in message [:content :command])))
(update :dispatch-n conj [:received-message (wallet-message (assoc message :message-id random-id))])))
(update :dispatch-n conj [:add-request chat-identifier enriched-message])))
{:db db})))
(def ^:private receive-interceptors

View File

@ -96,16 +96,7 @@
(dispatch [:set-chat-ui-props {:sending-in-progress? false}])
(dispatch [::send-command! add-to-chat-id (assoc params :command command') hidden-params])
(when (cu/console? chat-id)
(dispatch [:console-respond-command params]))
(when (and (= "send" (:name command))
(not= add-to-chat-id wallet-chat-id))
(let [ct (if request
c/content-type-wallet-request
c/content-type-wallet-command)
content' (assoc content :id (random/id)
:content-type ct)
params' (assoc params :command content')]
(dispatch [:prepare-command! wallet-chat-id params'])))))))
(dispatch [:console-respond-command params]))))))
(register-handler ::send-command!
(u/side-effect!

View File

@ -280,7 +280,7 @@
(into {}))
contacts (into {} contacts-list)
;;TODO temporary hide wallet contact, this code should be deleted after wallet contact will be deleted
contacts' (if (get-in contacts "wallet")
contacts' (if (get contacts "wallet")
(assoc-in contacts ["wallet" :pending?] true)
contacts)]
{:db (assoc db :contacts/contacts contacts'