From b1adf7aa68f62b1aef97f241202a05c45c9ec499 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Mon, 3 Apr 2017 13:56:26 +0300 Subject: [PATCH] fixes https://github.com/status-im/status-react/issues/961 --- src/status_im/chat/views/message.cljs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/status_im/chat/views/message.cljs b/src/status_im/chat/views/message.cljs index 4daefe5a15..349f5afe8a 100644 --- a/src/status_im/chat/views/message.cljs +++ b/src/status_im/chat/views/message.cljs @@ -307,15 +307,25 @@ photo-path)} :style st/photo}]]) +(defview my-photo [from] + [account [:get-current-account]] + (let [{:keys [photo-path]} account] + [view st/photo-view + [image {:source {:uri (if (str/blank? photo-path) + (identicon from) + photo-path)} + :style st/photo}]])) + (defn message-body - [{:keys [last-outgoing? message-type same-author from index] :as message} content] + [{:keys [last-outgoing? message-type same-author from index outgoing] :as message} content] (let [delivery-status :seen-by-everyone] [view st/group-message-wrapper [view (st/message-body message) [view st/message-author - (when (and (or (= index 1) (not same-author)) - (not= from "me")) - [member-photo from])] + (when (or (= index 1) (not same-author)) + (if outgoing + [my-photo from] + [member-photo from]))] [view (st/group-message-view message) content (when last-outgoing?