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

This commit is contained in:
codemaster 2023-12-11 14:13:16 -06:00 committed by GitHub
parent e31db856df
commit fc8590a05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View File

@ -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]))

View File

@ -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
@ -19,6 +34,7 @@
clock-value
album-id
message-type
content-type
from
outgoing
whisper-timestamp
@ -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)
:system-message? (or
(is-system-message? content-type message-type)
deleted?
deleted-for-me?))
deleted-for-me?)
:clock-value clock-value
:type :message
:message-id message-id