File tree Expand file tree Collapse file tree 4 files changed +25
-2
lines changed
Sources/StreamChatSwiftUI Expand file tree Collapse file tree 4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ struct MessageContainerView<Factory: ViewFactory>: View {
142
142
MessageAuthorAndDateView ( message: message)
143
143
} else if message. isSentByCurrentUser {
144
144
HStack ( spacing: 4 ) {
145
- MessageReadIndicatorView (
145
+ factory . makeMessageReadIndicatorView (
146
146
readUsers: channel. readUsers (
147
147
currentUserId: chatClient. currentUserId
148
148
) ,
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ public struct ChatChannelListItem: View {
71
71
}
72
72
73
73
HStack ( spacing: 4 ) {
74
- if let message = channel. latestMessages. first, message. isSentByCurrentUser {
74
+ if let message = channel. latestMessages. first,
75
+ message. isSentByCurrentUser,
76
+ !message. isDeleted {
75
77
MessageReadIndicatorView (
76
78
readUsers: channel. readUsers (
77
79
currentUserId: chatClient. currentUserId
Original file line number Diff line number Diff line change @@ -553,6 +553,16 @@ extension ViewFactory {
553
553
handleCommand: handleCommand
554
554
)
555
555
}
556
+
557
+ public func makeMessageReadIndicatorView(
558
+ readUsers: [ ChatUser ] ,
559
+ showReadCount: Bool
560
+ ) -> some View {
561
+ MessageReadIndicatorView (
562
+ readUsers: readUsers,
563
+ showReadCount: showReadCount
564
+ )
565
+ }
556
566
}
557
567
558
568
/// Default class conforming to `ViewFactory`, used throughout the SDK.
Original file line number Diff line number Diff line change @@ -541,4 +541,15 @@ public protocol ViewFactory: AnyObject {
541
541
suggestions: [ String : Any ] ,
542
542
handleCommand: @escaping ( [ String : Any ] ) -> Void
543
543
) -> CommandsContainerViewType
544
+
545
+ associatedtype MessageReadIndicatorViewType : View
546
+ /// Creates the message read indicator view.
547
+ /// - Parameters:
548
+ /// - readUsers: list of users who read the message.
549
+ /// - showReadCount: whether read count should be shown.
550
+ /// - Returns: view shown in the message read indicator slot.
551
+ func makeMessageReadIndicatorView(
552
+ readUsers: [ ChatUser ] ,
553
+ showReadCount: Bool
554
+ ) -> MessageReadIndicatorViewType
544
555
}
You can’t perform that action at this time.
0 commit comments