Skip to content

Commit

Permalink
Merge pull request #1725 from nextcloud/mention-everyone-details
Browse files Browse the repository at this point in the history
Show mention details when mentioning everyone
  • Loading branch information
SystemKeeper authored Jul 30, 2024
2 parents c147431 + db63f0e commit 5792cf5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 11 additions & 1 deletion NextcloudTalk/InputbarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,17 @@ import UIKit

let suggestion = self.autocompletionUsers[indexPath.row]

cell.titleLabel.text = suggestion.label
if let details = suggestion.details {
cell.titleLabel.numberOfLines = 2

let attributedLabel = (suggestion.label + "\n").withFont(.preferredFont(forTextStyle: .body))
let attributedDetails = details.withFont(.preferredFont(forTextStyle: .callout)).withTextColor(.secondaryLabel)
attributedLabel.append(attributedDetails)
cell.titleLabel.attributedText = attributedLabel
} else {
cell.titleLabel.numberOfLines = 1
cell.titleLabel.text = suggestion.label
}

if let suggestionUserStatus = suggestion.userStatus {
cell.setUserStatus(suggestionUserStatus)
Expand Down
2 changes: 2 additions & 0 deletions NextcloudTalk/MentionSuggestion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import Foundation
public var source: String
public var mentionId: String?
public var userStatus: String?
public var details: String?

init(dictionary: [String: Any]) {
self.id = dictionary["id"] as? String ?? ""
self.label = dictionary["label"] as? String ?? ""
self.source = dictionary["source"] as? String ?? ""
self.mentionId = dictionary["mentionId"] as? String
self.userStatus = dictionary["status"] as? String
self.details = dictionary["details"] as? String

super.init()
}
Expand Down
3 changes: 2 additions & 1 deletion NextcloudTalkTests/UI/UIRoomTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ final class UIRoomTest: XCTestCase {
textView.typeText("M")
textView.typeText("e")

let autoCompleteCell = app.tables.cells["AutoCompletionCellIdentifier"].staticTexts[newConversationName]
let predicate = NSPredicate(format: "label CONTAINS[c] %@", newConversationName)
let autoCompleteCell = app.tables.cells["AutoCompletionCellIdentifier"].staticTexts.containing(predicate).firstMatch
XCTAssert(autoCompleteCell.waitForExistence(timeout: TestConstants.timeoutShort))

autoCompleteCell.tap()
Expand Down

0 comments on commit 5792cf5

Please sign in to comment.