removed images in pills in favour of text decos

FIX

fix
This commit is contained in:
Mauro Romito
2025-03-17 11:37:50 +01:00
committed by Mauro
parent bbcb7e3641
commit f248bdfd92
41 changed files with 201 additions and 200 deletions
@@ -81,7 +81,7 @@ final class CompletionSuggestionService: CompletionSuggestionServiceProtocol {
if canMentionAllUsers,
!roomProxy.isDirectOneToOneRoom,
Self.shouldIncludeMember(userID: PillConstants.atRoom, displayName: PillConstants.everyone, searchText: suggestionTrigger.text) {
Self.shouldIncludeMember(userID: PillUtilities.atRoom, displayName: PillUtilities.everyone, searchText: suggestionTrigger.text) {
membersSuggestion
.insert(SuggestionItem(suggestionType: .allUsers(roomProxy.details.avatar), range: suggestionTrigger.range, rawSuggestionText: suggestionTrigger.text), at: 0)
}
@@ -49,7 +49,7 @@ struct SuggestionItem: Identifiable, Equatable {
case .user(let user):
user.id
case .allUsers:
PillConstants.atRoom
PillUtilities.atRoom
case .room(let room):
room.id
}
@@ -58,7 +58,7 @@ struct SuggestionItem: Identifiable, Equatable {
var displayName: String {
switch suggestionType {
case .allUsers:
return PillConstants.everyone
return PillUtilities.everyone
case .user(let user):
return user.displayName ?? user.id
case .room(let room):
@@ -69,7 +69,7 @@ struct SuggestionItem: Identifiable, Equatable {
var subtitle: String? {
switch suggestionType {
case .allUsers:
return PillConstants.atRoom
return PillUtilities.atRoom
case .user(let user):
return user.displayName == nil ? nil : user.id
case .room(let room):
@@ -413,7 +413,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
// Remove the attribute so it doesn't get inherited by the new string
attributedString.removeAttribute(.MatrixAllUsersMention, range: range)
attributedString.replaceCharacters(in: range, with: PillConstants.atRoom)
attributedString.replaceCharacters(in: range, with: PillUtilities.atRoom)
containsAtRoom = true
stop.pointee = true
@@ -464,7 +464,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
let attributedString: NSMutableAttributedString
// This is the all room mention special case
if urlString == PillConstants.composerAtRoomURLString {
if urlString == PillUtilities.composerAtRoomURLString {
attributedString = NSMutableAttributedString(string: string, attributes: [.MatrixAllUsersMention: true])
} else {
attributedString = NSMutableAttributedString(string: string, attributes: [.link: URL(string: urlString) as Any])