Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no avatar for the first message in 1-1 chat #18099

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[status-im2.constants :as constants]
[status-im2.contexts.chat.messages.drawers.view :as drawers]
[utils.re-frame :as rf]))
Expand Down
26 changes: 20 additions & 6 deletions src/status_im2/contexts/chat/messages/list/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
[utils.re-frame :as rf]
[utils.red-black-tree :as red-black-tree]))

(def is-system-message-content-type?
#{constants/content-type-system-text
constants/content-type-community
constants/content-type-system-message-mutual-event-accepted
constants/content-type-system-message-mutual-event-removed
constants/content-type-system-message-mutual-event-sent
constants/content-type-system-pinned-message})

(defn is-system-message?
[content-type message-type]
(or
(is-system-message-content-type? content-type)
(= constants/message-type-private-group-system-message
message-type)))

(defn- add-datemark
[{:keys [whisper-timestamp] :as msg}]
;;NOTE(performance) this is slow
Expand All @@ -19,6 +34,7 @@
clock-value
album-id
message-type
content-type
from
outgoing
whisper-timestamp
Expand All @@ -28,12 +44,10 @@
(-> {:whisper-timestamp whisper-timestamp
:from from
:one-to-one? (= constants/message-type-one-to-one message-type)
:system-message? (boolean
(or
(= constants/message-type-private-group-system-message
message-type)
deleted?
deleted-for-me?))
:system-message? (or
(is-system-message? content-type message-type)
deleted?
deleted-for-me?)
:clock-value clock-value
:type :message
:message-id message-id
Expand Down