Fix emote sending and edit message

This commit is contained in:
aringenbach
2022-05-03 15:16:02 +02:00
parent 286a8a1a81
commit a05923d911
5 changed files with 78 additions and 14 deletions
+2 -1
View File
@@ -30,6 +30,7 @@ class StringPillsUtils: NSObject {
/// - Returns: new attributed string with pills
static func insertPills(in attributedString: NSAttributedString,
withSession session: MXSession,
event: MXEvent,
andRoomState roomState: MXRoomState) -> NSAttributedString {
let newAttr = NSMutableAttributedString(attributedString: attributedString)
let totalRange = NSRange(location: 0, length: newAttr.length)
@@ -37,7 +38,7 @@ class StringPillsUtils: NSObject {
newAttr.vc_enumerateAttribute(.link, in: totalRange) { (url: URL, range: NSRange, _) in
if let userId = userIdFromPermalink(url.absoluteString),
let roomMember = roomState.members.member(withUserId: userId) {
let isCurrentUser = roomMember.userId == session.myUserId
let isCurrentUser = roomMember.userId == session.myUserId && event.sender != session.myUserId
let attachmentString = mentionPill(withRoomMember: roomMember,
andUrl: url,
isCurrentUser: isCurrentUser)