From fe78e7d786b9937b43b280a99f3429d36f17ed1d Mon Sep 17 00:00:00 2001 From: alwx Date: Tue, 18 Jul 2017 21:17:43 +0200 Subject: [PATCH] Can use requesting message to send ether if recipient name contains double quotes (#1411) --- src/status_im/chat/models/input.cljs | 10 +++++++--- src/status_im/chat/views/message/request_message.cljs | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/status_im/chat/models/input.cljs b/src/status_im/chat/models/input.cljs index f4a3928ac9..a7a83ec1f2 100644 --- a/src/status_im/chat/models/input.cljs +++ b/src/status_im/chat/models/input.cljs @@ -103,13 +103,17 @@ Input: ['/send' 'Jarrad' '1.0'] Output: '/send Jarrad 1.0' + Input: ['/send' '\"Jarrad\"' '1.0'] + Output: '/send Jarrad 1.0' + Input: ['/send' 'Complex name with space in between' '1.0'] Output: '/send \"Complex name with space in between\" 1.0'" (->> args (map (fn [arg] - (if (not (str/index-of arg const/spacing-char)) - arg - (str const/arg-wrapping-char arg const/arg-wrapping-char)))) + (let [arg (str/replace arg (re-pattern const/arg-wrapping-char) "")] + (if (not (str/index-of arg const/spacing-char)) + arg + (str const/arg-wrapping-char arg const/arg-wrapping-char))))) (str/join const/spacing-char))) (defn selected-chat-command diff --git a/src/status_im/chat/views/message/request_message.cljs b/src/status_im/chat/views/message/request_message.cljs index 99f3d87333..3ebbd92744 100644 --- a/src/status_im/chat/views/message/request_message.cljs +++ b/src/status_im/chat/views/message/request_message.cljs @@ -16,8 +16,7 @@ (def request-message-icon-scale-delay 600) (defn set-chat-command [message-id command] - (let [command-key (keyword (:name command)) - metadata {:to-message-id message-id}] + (let [metadata {:to-message-id message-id}] (dispatch [:select-chat-input-command command metadata]))) (def min-scale 1)