From b6f7cc86290c22f845b837425076cb3bfc6f729d Mon Sep 17 00:00:00 2001 From: alwx Date: Fri, 20 Oct 2017 00:10:46 +0200 Subject: [PATCH] #2185: After upgrade faucet, send and location messages are shown as plain text, request is shown without a text --- src/status_im/chat/events/commands.cljs | 26 +++++++++---------- .../realm/schemas/account/v15/core.cljs | 3 ++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/status_im/chat/events/commands.cljs b/src/status_im/chat/events/commands.cljs index b97d2d25d1..a227864dd7 100644 --- a/src/status_im/chat/events/commands.cljs +++ b/src/status_im/chat/events/commands.cljs @@ -24,26 +24,26 @@ (defn request-command-message-data "Requests command message data from jail" [db - {{command-name :command + {{command-name :command content-command-name :content-command - :keys [content-command-scope - scope - params - type - bot]} :content - :keys [chat-id jail-id group-id] :as message} + :keys [content-command-scope scope params type bot]} :content + :keys [chat-id jail-id group-id] :as message} data-type] (let [{:keys [chats] :accounts/keys [current-account-id] :contacts/keys [contacts]} db - jail-id (or bot jail-id chat-id) - jail-id (if (get-in chats [jail-id :group-chat]) - (get-in chats [jail-id :possible-commands (keyword command-name) :owner-id]) - jail-id)] + jail-id (or bot jail-id chat-id) + jail-command-name (or content-command-name command-name) + ;; here we're trying to use the default scope if there is no other scope provided + default-command-scope (-> (get-in contacts [jail-id :commands (keyword jail-command-name)]) + first + :scope)] (if (get-in contacts [jail-id :commands-loaded?]) (let [path [(if (= :response (keyword type)) :responses :commands) - [(if content-command-name content-command-name command-name) - (commands-model/scope->bit-mask (or scope content-command-scope))] + [jail-command-name + (commands-model/scope->bit-mask (or scope + content-command-scope + default-command-scope))] data-type] to (get-in contacts [chat-id :address]) jail-params {:parameters params diff --git a/src/status_im/data_store/realm/schemas/account/v15/core.cljs b/src/status_im/data_store/realm/schemas/account/v15/core.cljs index b949584f0b..43f6b1fd2e 100644 --- a/src/status_im/data_store/realm/schemas/account/v15/core.cljs +++ b/src/status_im/data_store/realm/schemas/account/v15/core.cljs @@ -37,4 +37,5 @@ handler-data/schema]) (defn migration [old-realm new-realm] - (log/debug "migrating v15 account database: " old-realm new-realm)) \ No newline at end of file + (log/debug "migrating v15 account database: " old-realm new-realm) + (contact/migration old-realm new-realm)) \ No newline at end of file