From 0bee6439d6a6f8e67bff7c3a28650361d017b741 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 8 Jun 2017 17:29:03 +0300 Subject: [PATCH] to and from props in context in suggestions function --- src/status_im/chat/handlers/input.cljs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/status_im/chat/handlers/input.cljs b/src/status_im/chat/handlers/input.cljs index b5bf534e8c4..905180a1f02 100644 --- a/src/status_im/chat/handlers/input.cljs +++ b/src/status_im/chat/handlers/input.cljs @@ -113,7 +113,8 @@ (handlers/register-handler :load-chat-parameter-box (handlers/side-effect! - (fn [{:keys [current-chat-id] :as db} [_ {:keys [name type bot] :as command}]] + (fn [{:keys [current-chat-id current-account-id] :as db} + [_ {:keys [name type bot] :as command}]] (let [parameter-index (input-model/argument-position db current-chat-id)] (when (and command (> parameter-index -1)) (let [jail-id (or bot current-chat-id) @@ -126,8 +127,12 @@ args (-> (get-in db [:chats current-chat-id :input-text]) (input-model/split-command-args) (rest)) + to (get-in db [:contacts current-chat-id :address]) + from (get-in db []) params {:parameters {:args args} - :context (merge {:data data} + :context (merge {:data data + :from current-account-id + :to to} (input-model/command-dependent-context-params command))}] (status/call-jail {:jail-id jail-id