From f597bb66194316be744f89f435f7acdf1067125d Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 5 Apr 2022 02:34:36 +0300 Subject: [PATCH 1/7] Do not scale room name in thread header --- .../Modules/Room/Views/Title/Thread/ThreadRoomTitleView.xib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Room/Views/Title/Thread/ThreadRoomTitleView.xib b/Riot/Modules/Room/Views/Title/Thread/ThreadRoomTitleView.xib index 08667bfdc9..c4af2bd923 100644 --- a/Riot/Modules/Room/Views/Title/Thread/ThreadRoomTitleView.xib +++ b/Riot/Modules/Room/Views/Title/Thread/ThreadRoomTitleView.xib @@ -1,9 +1,9 @@ - + - + @@ -58,7 +58,7 @@ - From a345436414631ea7f34b770186e154c9af68ea72 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 5 Apr 2022 02:39:42 +0300 Subject: [PATCH 6/7] Add changelog --- changelog.d/5878.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5878.bugfix diff --git a/changelog.d/5878.bugfix b/changelog.d/5878.bugfix new file mode 100644 index 0000000000..cbd1ee8421 --- /dev/null +++ b/changelog.d/5878.bugfix @@ -0,0 +1 @@ +Threads: Tweaks for design review. From df0feba45c3a434d51b414d29b143346ae9da8d4 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Tue, 5 Apr 2022 13:09:37 +0300 Subject: [PATCH 7/7] Move extension into Element --- Riot/Categories/NSAttributedString.swift | 27 +++++++++++++++++++ .../NSAttributedString+MatrixKit.swift | 7 ----- .../ThreadList/ThreadListViewModel.swift | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 Riot/Categories/NSAttributedString.swift diff --git a/Riot/Categories/NSAttributedString.swift b/Riot/Categories/NSAttributedString.swift new file mode 100644 index 0000000000..65c2db8a73 --- /dev/null +++ b/Riot/Categories/NSAttributedString.swift @@ -0,0 +1,27 @@ +// +// Copyright 2022 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +public extension NSAttributedString { + + /// Returns a new attributed string by removing all links from the receiver. + @objc var vc_byRemovingLinks: NSAttributedString { + let result = NSMutableAttributedString(attributedString: self) + result.removeAttribute(.link, range: NSRange(location: 0, length: length)) + return result + } +} diff --git a/Riot/Modules/MatrixKit/Categories/NSAttributedString+MatrixKit.swift b/Riot/Modules/MatrixKit/Categories/NSAttributedString+MatrixKit.swift index afee518685..c72e5c76ca 100644 --- a/Riot/Modules/MatrixKit/Categories/NSAttributedString+MatrixKit.swift +++ b/Riot/Modules/MatrixKit/Categories/NSAttributedString+MatrixKit.swift @@ -29,11 +29,4 @@ public extension NSAttributedString { return unquotedSubstrings.joined(separator: " ") as NSString } - - /// Returns a new attributed string by removing all links from the receiver. - @objc var byRemovingLinks: NSAttributedString { - let result = NSMutableAttributedString(attributedString: self) - result.removeAttribute(.link, range: NSRange(location: 0, length: length)) - return result - } } diff --git a/Riot/Modules/Threads/ThreadList/ThreadListViewModel.swift b/Riot/Modules/Threads/ThreadList/ThreadListViewModel.swift index 1f2dd01f59..7e197226a0 100644 --- a/Riot/Modules/Threads/ThreadList/ThreadListViewModel.swift +++ b/Riot/Modules/Threads/ThreadList/ThreadListViewModel.swift @@ -209,7 +209,7 @@ final class ThreadListViewModel: ThreadListViewModelProtocol { let formatterError = UnsafeMutablePointer.allocate(capacity: 1) return eventFormatter.attributedString(from: message.replyStrippedVersion, with: roomState, - error: formatterError).byRemovingLinks + error: formatterError).vc_byRemovingLinks } private func lastMessageTextAndTime(forThread thread: MXThreadProtocol) -> (NSAttributedString?, String?) {