Merge pull request #7649 from vector-im/stefan/variousBugFixes

Various bug fixes
This commit is contained in:
Stefan Ceriu
2023-08-23 16:03:07 +03:00
committed by GitHub
6 changed files with 18 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ PODS:
- GBDeviceInfo/Core (= 7.1.0)
- GBDeviceInfo/Core (7.1.0)
- GZIP (1.3.0)
- Introspect (0.1.4)
- Introspect (0.11.0)
- JitsiMeetSDKLite (8.1.2-lite):
- JitsiWebRTC (~> 111.0)
- JitsiWebRTC (111.0.2)
@@ -177,7 +177,7 @@ SPEC CHECKSUMS:
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
GBDeviceInfo: 5d62fa85bdcce3ed288d83c28789adf1173e4376
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
Introspect: 4cc1e4c34dd016540c8d86a591c231c09dafbee3
JitsiMeetSDKLite: 895213158cf62342069a10634a41d2f1c00057f7
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
@@ -210,4 +210,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: f8f66ce4fa24937192a493d3a0a5c2c2e429c8fc
COCOAPODS: 1.11.3
COCOAPODS: 1.12.1

View File

@@ -197,12 +197,14 @@ class PillsFormatter: NSObject {
guard let roomMember = roomState.members.member(withUserId: userId) else {
return
}
let displayName = roomMember.displayname ?? userId
pill.data?.items = [
.avatar(url: roomMember.avatarUrl,
string: roomMember.displayname,
matrixId: roomMember.userId),
.text(roomMember.displayname)
string: displayName,
matrixId: userId),
.text(displayName)
]
default:
break

View File

@@ -207,8 +207,14 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
}
func mention(_ member: MXRoomMember) {
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: member.userId),
name: member.displayname,
guard let userId = member.userId else {
return
}
let displayName = member.displayname ?? userId
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: userId),
name: displayName,
mentionType: .user)
}

View File

@@ -49,10 +49,4 @@ extension View {
func listBackgroundColor(_ color: Color) -> some View {
modifier(ListBackgroundModifier(color: color))
}
/// Finds a `UICollectionView` from a `SwiftUI.List`, or `SwiftUI.List` child.
/// Stop gap until https://github.com/siteline/SwiftUI-Introspect/pull/169
func introspectCollectionView(customize: @escaping (UICollectionView) -> Void) -> some View {
introspect(selector: TargetViewSelector.ancestorOrSiblingContaining, customize: customize)
}
}

1
changelog.d/7651.bugfix Normal file
View File

@@ -0,0 +1 @@
Prevent pill crashes when room members are missing display names (objc interop)

View File

@@ -0,0 +1 @@
Prevent mention crashes when room members are missing display names (objc interop)