Skip to content
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
1 change: 1 addition & 0 deletions NextcloudTalk/Chat/Chat cells/BaseChatTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ class BaseChatTableViewCell: UITableViewCell, AudioPlayerViewDelegate, Reactions
activityIndicator.strokeWidth = 1.5
activityIndicator.cycleColors = [.secondaryLabel]
activityIndicator.startAnimating()
activityIndicator.accessibilityIdentifier = "MessageSending"
activityIndicator.widthAnchor.constraint(equalToConstant: 20).isActive = true

self.statusView.addArrangedSubview(activityIndicator)
Expand Down
2 changes: 1 addition & 1 deletion NextcloudTalk/Chat/NCChatController.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ - (NSArray *)getBatchOfMessagesInBlock:(NCChatBlock *)chatBlock fromMessageId:(N

- (NSArray *)getNewStoredMessagesInBlock:(NCChatBlock *)chatBlock sinceMessageId:(NSInteger)messageId
{
NSPredicate *query = [NSPredicate predicateWithFormat:@"accountId = %@ AND token = %@ AND messageId > %ld AND messageId <= %ld AND (threadId == 0 OR threadId == messageId)", _account.accountId, _room.token, (long)messageId, (long)chatBlock.newestMessageId];
NSPredicate *query = [NSPredicate predicateWithFormat:@"accountId = %@ AND token = %@ AND messageId > %ld AND messageId <= %ld AND (isThread == 0 OR threadId == 0 OR threadId == messageId)", _account.accountId, _room.token, (long)messageId, (long)chatBlock.newestMessageId];

if ([self isThreadController]) {
query = [NSPredicate predicateWithFormat:@"accountId = %@ AND token = %@ AND threadId = %ld AND messageId > %ld AND messageId <= %ld", _account.accountId, _room.token, _threadId, (long)messageId, (long)chatBlock.newestMessageId];
Expand Down
37 changes: 37 additions & 0 deletions NextcloudTalkTests/UI/UIRoomTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,43 @@ final class UIRoomTest: XCTestCase {
XCTAssert(app.staticTexts["{}"].waitForExistence(timeout: TestConstants.timeoutShort))
}

func testMessageQuoting() {
let app = launchAndLogin()
let newConversationName = "QuoteTest"

// Create a new test conversion
self.createConversation(for: app, with: newConversationName)

// Send a test message
let testMessage = "TestMessage"
let replyMessage = "ReplyMessage"

let toolbar = app.toolbars["Toolbar"]
let textView = toolbar.textViews["Write message, @ to mention someone …"]
XCTAssert(textView.waitForExistence(timeout: TestConstants.timeoutShort))
textView.tap()
app.typeText(testMessage)
let sendMessageButton = toolbar.buttons["Send message"]
sendMessageButton.tap()

// Wait for temporary message to be replaced
let messageSentImage = app.images["MessageSent"]
XCTAssert(messageSentImage.waitForExistence(timeout: TestConstants.timeoutShort))

// Open context menu
messageSentImage.press(forDuration: 2.0)

// Start a reply
XCTAssert(messageSentImage.waitForExistence(timeout: TestConstants.timeoutShort))
waitForReady(object: app.buttons["Reply"]).tap()

// Send message and check if temporary message is replaced
textView.tap()
app.typeText(replyMessage)
sendMessageButton.tap()
XCTAssert(app.otherElements["MessageSending"].waitForNonExistence(timeout: TestConstants.timeoutShort))
}

func testChatViewControllerMentions() {
let app = launchAndLogin()
let newConversationName = "MentionTest 🇨🇨"
Expand Down