File tree 4 files changed +25
-10
lines changed
4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 452
452
(fn [{:keys [public-key]}]
453
453
public-key))
454
454
455
+ (re-frame/reg-sub
456
+ :multiaccount/preferred-name
457
+ :<- [:multiaccount ]
458
+ (fn [{:keys [preferred-name]}]
459
+ preferred-name))
460
+
461
+ (re-frame/reg-sub
462
+ :multiaccount/my-name
463
+ :<- [:multiaccount/public-key ]
464
+ :<- [:multiaccount/preferred-name ]
465
+ (fn [[identity preferred-name]]
466
+ (if preferred-name
467
+ (stateofus/username (str " @" preferred-name))
468
+ (gfycat/generate-gfy identity))))
469
+
455
470
(re-frame/reg-sub
456
471
:multiaccount/default-account
457
472
:<- [:multiaccount/accounts ]
Original file line number Diff line number Diff line change 103
103
104
104
(defn group-chat-actions []
105
105
(fn [{:keys [chat-id group-chat chat-name color]}]
106
- (let [joined @(re-frame/subscribe [:group-chat/chat-joined? chat-id])]
106
+ (let [{ :keys [ joined?]} @(re-frame/subscribe [:group-chat/inviter-info chat-id])]
107
107
[react/view
108
108
[list-item/list-item
109
109
{:theme :action
131
131
:accessibility-label :fetch-history-button
132
132
:icon :main-icons/arrow-down
133
133
:on-press #(hide-sheet-and-dispatch [:chat.ui/fetch-history-pressed chat-id])}]
134
- (when joined
134
+ (when joined?
135
135
[list-item/list-item
136
136
{:theme :action
137
137
:title :t/leave-chat
Original file line number Diff line number Diff line change 18
18
[status-im.ui.components.radio :as radio]
19
19
[status-im.ui.components.react :as react]
20
20
[status-im.ui.components.topbar :as topbar]
21
+ [status-im.ui.screens.chat.utils :as chat.utils]
21
22
[status-im.ui.screens.chat.message.message :as message]
23
+ [status-im.ui.screens.chat.styles.message.message :as message.style]
22
24
[status-im.ui.screens.chat.photos :as photos]
23
25
[status-im.ui.screens.profile.components.views :as profile.components]
24
26
[status-im.utils.debounce :as debounce])
624
626
[name-item {:name name :hide-chevron? true :action action}]]
625
627
[radio/radio (= name preferred-name)]]]))]]]])
626
628
629
+ (views/defview my-name []
630
+ (views/letsubs [contact-name [:multiaccount/my-name ]]
631
+ (chat.utils/format-author contact-name message.style/message-author-name-container)))
632
+
627
633
(defn- registered [names {:keys [preferred-name public-key] :as account} _]
628
634
[react/view {:style {:flex 1 }}
629
635
[react/scroll-view
663
669
:timestamp-str " 9:41 AM" }]
664
670
[react/view
665
671
[react/view {:padding-left 72 }
666
- [message/message-author- name public-key ]]
672
+ [my- name]]
667
673
[react/view {:flex-direction :row }
668
674
[react/view {:padding-left 16 :padding-right 8 :padding-top 4 }
669
675
[photos/photo (multiaccounts/displayed-photo account) {:size 36 }]]
Original file line number Diff line number Diff line change 101
101
:accessibility-label :unviewed-messages-public }]
102
102
[badge/message-counter unviewed-messages-count])))
103
103
104
- (defview one-to-one-title [from]
105
- (letsubs [contact-name [:contacts/contact-name-by-identity from]]
106
- [react/text-class
107
- {:accessibility-label :chat-name-text }
108
- (utils/truncate-str contact-name 30 )]))
109
-
110
104
(defn home-list-item [[_ home-item]]
111
105
(let [{:keys [chat-id chat-name color online group-chat
112
106
public? timestamp last-message]}
122
116
:else nil )
123
117
:title (if group-chat
124
118
(utils/truncate-str chat-name 30 )
125
- [one-to-one-title chat-id])
119
+ @( re-frame/subscribe [ :contacts/contact-name-by-identity chat-id]) )
126
120
:title-accessibility-label :chat-name-text
127
121
:title-row-accessory [message-timestamp (if (pos? (:whisper-timestamp last-message))
128
122
(:whisper-timestamp last-message)
You can’t perform that action at this time.
0 commit comments