Skip to content

Commit

Permalink
Merge pull request #7649 from vector-im/stefan/variousBugFixes
Browse files Browse the repository at this point in the history
Various bug fixes
  • Loading branch information
stefanceriu authored Aug 23, 2023
2 parents b7ffeda + 021af05 commit 83e7229
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -177,7 +177,7 @@ SPEC CHECKSUMS:
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
GBDeviceInfo: 5d62fa85bdcce3ed288d83c28789adf1173e4376
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
Introspect: 4cc1e4c34dd016540c8d86a591c231c09dafbee3
JitsiMeetSDKLite: 895213158cf62342069a10634a41d2f1c00057f7
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
Expand Down Expand Up @@ -210,4 +210,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: f8f66ce4fa24937192a493d3a0a5c2c2e429c8fc

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
8 changes: 5 additions & 3 deletions Riot/Modules/Pills/PillsFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
6 changes: 0 additions & 6 deletions RiotSwiftUI/Modules/Common/Util/ListBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions changelog.d/7651.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent pill crashes when room members are missing display names (objc interop)
1 change: 1 addition & 0 deletions changelog.d/pr-7649.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent mention crashes when room members are missing display names (objc interop)

0 comments on commit 83e7229

Please sign in to comment.