Skip to content

Commit

Permalink
to and from props in context in suggestions function
Browse files Browse the repository at this point in the history
  • Loading branch information
rasom committed Jun 8, 2017
1 parent 08b7faf commit 0bee643
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/status_im/chat/handlers/input.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 0bee643

Please sign in to comment.