From 197695c79e297aa9304080c1c3c5ca0440e591a9 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 14 Oct 2016 16:42:30 +0300 Subject: [PATCH] fix #354 Former-commit-id: f51d932283f9a795482791334da71a9fa0b0d747 --- src/status_im/chat/views/request_message.cljs | 6 +++--- src/status_im/data_store/messages.cljs | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/status_im/chat/views/request_message.cljs b/src/status_im/chat/views/request_message.cljs index d467483b1c..05df2a70d0 100644 --- a/src/status_im/chat/views/request_message.cljs +++ b/src/status_im/chat/views/request_message.cljs @@ -5,6 +5,7 @@ animated-view text image + icon touchable-highlight]] [status-im.chat.styles.message :as st] [status-im.models.commands :refer [parse-command-request]] @@ -64,9 +65,8 @@ :style st/command-request-image-touchable :accessibility-label (label command)} [animated-view {:style (st/command-request-image-view command scale-anim-val)} - (if command-icon - [image {:source {:uri command-icon} - :style st/command-request-image}])]]))}))) + (when command-icon + [icon command-icon st/command-request-image])]]))}))) (defn message-content-command-request [{:keys [message-id content from incoming-group]}] diff --git a/src/status_im/data_store/messages.cljs b/src/status_im/data_store/messages.cljs index b5fcdc8ea0..6dbc9ffbfd 100644 --- a/src/status_im/data_store/messages.cljs +++ b/src/status_im/data_store/messages.cljs @@ -14,7 +14,12 @@ (defn- str-to-map [s] - (keywordize-keys (apply hash-map (split s #"[;=]")))) + (->> (keywordize-keys (apply hash-map (split s #"[;=]"))) + (map (fn [[k v]] + [k (if (= k :params) + (read-string v) + v)])) + (into {}))) (defn- user-statuses-to-map [user-statuses] @@ -76,9 +81,9 @@ (map-to-str content)) message' (merge default-values message - {:chat-id chat-id - :content content' - :timestamp (timestamp)})] + {:chat-id chat-id + :content content' + :timestamp (timestamp)})] (data-store/save message')))) (defn update