Can use requesting message to send ether if recipient name contains double quotes (#1411)

This commit is contained in:
alwx 2017-07-18 21:17:43 +02:00 committed by Roman Volosovskyi
parent 32b64dcdb9
commit fe78e7d786
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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)