Skip to content

Fix swipe to reply enabled when quoting a message is disabled #824

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

Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### ✅ Added
- Add extra data to user display info [#819](https://github.com/GetStream/stream-chat-swiftui/pull/819)
### 🐞 Fixed
- Fix swipe to reply enabled when quoting a message is disabled [#824](https://github.com/GetStream/stream-chat-swiftui/pull/824)

# [4.78.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.78.0)
_April 24, 2025_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
private let paddingValue: CGFloat = 8

var isSwipeToReplyPossible: Bool {
message.isInteractionEnabled && channel.config.repliesEnabled
message.isInteractionEnabled && channel.canQuoteMessage
}

public init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class MessageContainerView_Tests: StreamChatTestCase {
waitForExpectations(timeout: 1)
}

func test_isSwipeToReplyPossible_whenRepliesEnabled_whenMessageInteractable_shouldBeTrue() {
func test_isSwipeToReplyPossible_whenCanQuoteReply_whenMessageInteractable_shouldBeTrue() {
let message = ChatMessage.mock(
id: .unique,
cid: .unique,
Expand All @@ -414,7 +414,7 @@ class MessageContainerView_Tests: StreamChatTestCase {

let view = MessageContainerView(
factory: DefaultViewFactory.shared,
channel: .mockDMChannel(config: .mock(repliesEnabled: true)),
channel: .mockDMChannel(ownCapabilities: [.quoteMessage]),
message: message,
width: defaultScreenSize.width,
showsAllInfo: true,
Expand All @@ -428,7 +428,7 @@ class MessageContainerView_Tests: StreamChatTestCase {
XCTAssertTrue(view.isSwipeToReplyPossible)
}

func test_isSwipeToReplyPossible_whenRepliesDisabled_whenMessageInteractable_shouldBeFalse() {
func test_isSwipeToReplyPossible_whenCanNotQuoteReply_whenMessageInteractable_shouldBeFalse() {
let message = ChatMessage.mock(
id: .unique,
cid: .unique,
Expand All @@ -439,7 +439,7 @@ class MessageContainerView_Tests: StreamChatTestCase {

let view = MessageContainerView(
factory: DefaultViewFactory.shared,
channel: .mockDMChannel(config: .mock(repliesEnabled: false)),
channel: .mockDMChannel(ownCapabilities: []),
message: message,
width: defaultScreenSize.width,
showsAllInfo: true,
Expand All @@ -453,7 +453,7 @@ class MessageContainerView_Tests: StreamChatTestCase {
XCTAssertFalse(view.isSwipeToReplyPossible)
}

func test_isSwipeToReplyPossible_whenRepliesEnabled_whenMessageNotInteractable_shouldBeFalse() {
func test_isSwipeToReplyPossible_whenCanQuoteReply_whenMessageNotInteractable_shouldBeFalse() {
let message = ChatMessage.mock(
id: .unique,
cid: .unique,
Expand All @@ -465,7 +465,7 @@ class MessageContainerView_Tests: StreamChatTestCase {

let view = MessageContainerView(
factory: DefaultViewFactory.shared,
channel: .mockDMChannel(config: .mock(repliesEnabled: true)),
channel: .mockDMChannel(ownCapabilities: [.quoteMessage]),
message: message,
width: defaultScreenSize.width,
showsAllInfo: true,
Expand Down
Loading