Skip to content

Commit fe78e7d

Browse files
alwxrasom
authored andcommitted
Can use requesting message to send ether if recipient name contains double quotes (status-im#1411)
1 parent 32b64dc commit fe78e7d

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/status_im/chat/models/input.cljs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,17 @@
103103
Input: ['/send' 'Jarrad' '1.0']
104104
Output: '/send Jarrad 1.0'
105105
106+
Input: ['/send' '\"Jarrad\"' '1.0']
107+
Output: '/send Jarrad 1.0'
108+
106109
Input: ['/send' 'Complex name with space in between' '1.0']
107110
Output: '/send \"Complex name with space in between\" 1.0'"
108111
(->> args
109112
(map (fn [arg]
110-
(if (not (str/index-of arg const/spacing-char))
111-
arg
112-
(str const/arg-wrapping-char arg const/arg-wrapping-char))))
113+
(let [arg (str/replace arg (re-pattern const/arg-wrapping-char) "")]
114+
(if (not (str/index-of arg const/spacing-char))
115+
arg
116+
(str const/arg-wrapping-char arg const/arg-wrapping-char)))))
113117
(str/join const/spacing-char)))
114118

115119
(defn selected-chat-command

src/status_im/chat/views/message/request_message.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
(def request-message-icon-scale-delay 600)
1717

1818
(defn set-chat-command [message-id command]
19-
(let [command-key (keyword (:name command))
20-
metadata {:to-message-id message-id}]
19+
(let [metadata {:to-message-id message-id}]
2120
(dispatch [:select-chat-input-command command metadata])))
2221

2322
(def min-scale 1)

0 commit comments

Comments
 (0)