Skip to content

Commit 723b7fa

Browse files
Implemented channel config for replies
1 parent f4f2641 commit 723b7fa

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct MessageContainerView<Factory: ViewFactory>: View {
103103
coordinateSpace: .local
104104
)
105105
.updating($offset) { (value, gestureState, _) in
106-
if message.isDeleted {
106+
if message.isDeleted || !channel.config.repliesEnabled {
107107
return
108108
}
109109
// Using updating since onEnded is not called if the gesture is canceled.

Sources/StreamChatSwiftUI/ChatChannel/Reactions/MessageActions/DefaultMessageActions.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@ extension MessageAction {
2323
) -> [MessageAction] {
2424
var messageActions = [MessageAction]()
2525

26-
let replyAction = replyAction(
27-
for: message,
28-
channel: channel,
29-
onFinish: onFinish
30-
)
31-
messageActions.append(replyAction)
32-
33-
if !message.isPartOfThread {
34-
let replyThread = threadReplyAction(
35-
factory: factory,
26+
if channel.config.repliesEnabled {
27+
let replyAction = replyAction(
3628
for: message,
37-
channel: channel
29+
channel: channel,
30+
onFinish: onFinish
3831
)
39-
messageActions.append(replyThread)
32+
messageActions.append(replyAction)
33+
34+
if !message.isPartOfThread {
35+
let replyThread = threadReplyAction(
36+
factory: factory,
37+
for: message,
38+
channel: channel
39+
)
40+
messageActions.append(replyThread)
41+
}
4042
}
4143

4244
if message.isSentByCurrentUser {

0 commit comments

Comments
 (0)