Tappable request message (closes #283)

Former-commit-id: 8026bdad0b520f2140f5c90bfae9e7b274867246
This commit is contained in:
Roman Volosovskyi 2016-10-07 16:01:10 +03:00
parent c15fca6bd3
commit 9653028650

View File

@ -70,19 +70,23 @@
(defn message-content-command-request (defn message-content-command-request
[{:keys [message-id content from incoming-group]}] [{:keys [message-id content from incoming-group]}]
(let [commands-atom (subscribe [:get-responses])] (let [commands-atom (subscribe [:get-responses])
answered? (subscribe [:is-request-answered? message-id])]
(fn [{:keys [message-id content from incoming-group]}] (fn [{:keys [message-id content from incoming-group]}]
(let [commands @commands-atom (let [commands @commands-atom
{:keys [command content]} (parse-command-request commands content)] {:keys [command content]} (parse-command-request commands content)]
[view st/comand-request-view [view st/comand-request-view
[view st/command-request-message-view [touchable-highlight
(when incoming-group {:on-press (when-not @answered?
[text {:style st/command-request-from-text #(set-chat-command message-id command))}
:font :default} [view st/command-request-message-view
from]) (when incoming-group
[text {:style st/style-message-text [text {:style st/command-request-from-text
:font :default} :font :default}
content]] from])
[text {:style st/style-message-text
:font :default}
content]]]
[request-button message-id command] [request-button message-id command]
(when (:request-text command) (when (:request-text command)
[view st/command-request-text-view [view st/command-request-text-view