Skip to content

Commit a4ea552

Browse files
Show a verification badge on the Room Member/User Profile screens. (#3427)
* Add a badge for verified users/room members. * Reorder subviews. * Add a (disabled) button to verify other users. * PR comments. * Update the SDK. * Adopt the SDK changes introduced in matrix-rust-sdk/pull/4100 --------- Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
1 parent a0c81cf commit a4ea552

File tree

50 files changed

+522
-275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+522
-275
lines changed

ElementX.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@
899899
C76892321558E75101E68ED6 /* ReadableFrameModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398817652FA8ABAE0A31AC6D /* ReadableFrameModifier.swift */; };
900900
C7774720A4B2E34693E3227C /* RoomNotificationSettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8896CDD20CA2D87EA3B848A1 /* RoomNotificationSettingsScreen.swift */; };
901901
C7ABEBECDC513F7887DACF66 /* ProgressMaskModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68010886142843705E342645 /* ProgressMaskModifier.swift */; };
902+
C7B07EBA0F12B5912DA9BB97 /* UserIdentitySDKMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */; };
902903
C80E06ED97CE52704A46C148 /* ClientBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1C33355FFB0F0953C35036 /* ClientBuilder.swift */; };
903904
C85C7A201E4CFDA477ACEBEB /* AppLockSetupSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8610C1D21565C950BCA6A454 /* AppLockSetupSettingsScreenViewModelProtocol.swift */; };
904905
C8A9C595038AFA2D707AC8C1 /* NotificationPermissionsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20E69F67D2A70ABD08CA6D54 /* NotificationPermissionsScreenViewModelProtocol.swift */; };
@@ -2221,6 +2222,7 @@
22212222
E8A1F98AE670377B20679FF5 /* MediaPlayerProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayerProvider.swift; sourceTree = "<group>"; };
22222223
E8AE4B3273BA189FDCD4055C /* UserIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicator.swift; sourceTree = "<group>"; };
22232224
E8CA187FE656EE5A3F6C7DE5 /* UIFont+AttributedStringBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIFont+AttributedStringBuilder.m"; sourceTree = "<group>"; };
2225+
E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIdentitySDKMock.swift; sourceTree = "<group>"; };
22242226
E96ED747FF90332EA1333C22 /* RoomTimelineItemFixtures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemFixtures.swift; sourceTree = "<group>"; };
22252227
E992D7B8BE54B2AB454613AF /* XCUIElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCUIElement.swift; sourceTree = "<group>"; };
22262228
E9A3D3CFA199FA7897364547 /* CallInviteRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInviteRoomTimelineItem.swift; sourceTree = "<group>"; };
@@ -5276,6 +5278,7 @@
52765278
isa = PBXGroup;
52775279
children = (
52785280
8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */,
5281+
E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */,
52795282
);
52805283
path = SDK;
52815284
sourceTree = "<group>";
@@ -7007,6 +7010,7 @@
70077010
828EA5009557C2B9DCD4CA0F /* UserDiscoverySection.swift in Sources */,
70087011
044DD8F80231BC30570F7965 /* UserDiscoveryService.swift in Sources */,
70097012
1C409A26A99F0371C47AFA51 /* UserDiscoveryServiceProtocol.swift in Sources */,
7013+
C7B07EBA0F12B5912DA9BB97 /* UserIdentitySDKMock.swift in Sources */,
70107014
988BA75A182738150894A23F /* UserIndicator.swift in Sources */,
70117015
C4E0D03DF88242697545A9B7 /* UserIndicatorController.swift in Sources */,
70127016
3467FEE8210D301FF1B77001 /* UserIndicatorControllerMock.swift in Sources */,
@@ -7818,7 +7822,7 @@
78187822
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
78197823
requirement = {
78207824
kind = exactVersion;
7821-
version = 1.0.58;
7825+
version = 1.0.59;
78227826
};
78237827
};
78247828
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {

ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElementX/Sources/Mocks/ClientProxyMock.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,7 @@ extension ClientProxyMock {
9393

9494
return await .joined(JoinedRoomProxyMock(.init(id: room.id, name: room.name)))
9595
}
96+
97+
userIdentityForReturnValue = .success(UserIdentitySDKMock(configuration: .init()))
9698
}
9799
}

ElementX/Sources/Mocks/Generated/GeneratedMocks.swift

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,6 +4700,76 @@ class ClientProxyMock: ClientProxyProtocol {
47004700
return resetIdentityReturnValue
47014701
}
47024702
}
4703+
//MARK: - userIdentity
4704+
4705+
var userIdentityForUnderlyingCallsCount = 0
4706+
var userIdentityForCallsCount: Int {
4707+
get {
4708+
if Thread.isMainThread {
4709+
return userIdentityForUnderlyingCallsCount
4710+
} else {
4711+
var returnValue: Int? = nil
4712+
DispatchQueue.main.sync {
4713+
returnValue = userIdentityForUnderlyingCallsCount
4714+
}
4715+
4716+
return returnValue!
4717+
}
4718+
}
4719+
set {
4720+
if Thread.isMainThread {
4721+
userIdentityForUnderlyingCallsCount = newValue
4722+
} else {
4723+
DispatchQueue.main.sync {
4724+
userIdentityForUnderlyingCallsCount = newValue
4725+
}
4726+
}
4727+
}
4728+
}
4729+
var userIdentityForCalled: Bool {
4730+
return userIdentityForCallsCount > 0
4731+
}
4732+
var userIdentityForReceivedUserID: String?
4733+
var userIdentityForReceivedInvocations: [String] = []
4734+
4735+
var userIdentityForUnderlyingReturnValue: Result<UserIdentity?, ClientProxyError>!
4736+
var userIdentityForReturnValue: Result<UserIdentity?, ClientProxyError>! {
4737+
get {
4738+
if Thread.isMainThread {
4739+
return userIdentityForUnderlyingReturnValue
4740+
} else {
4741+
var returnValue: Result<UserIdentity?, ClientProxyError>? = nil
4742+
DispatchQueue.main.sync {
4743+
returnValue = userIdentityForUnderlyingReturnValue
4744+
}
4745+
4746+
return returnValue!
4747+
}
4748+
}
4749+
set {
4750+
if Thread.isMainThread {
4751+
userIdentityForUnderlyingReturnValue = newValue
4752+
} else {
4753+
DispatchQueue.main.sync {
4754+
userIdentityForUnderlyingReturnValue = newValue
4755+
}
4756+
}
4757+
}
4758+
}
4759+
var userIdentityForClosure: ((String) async -> Result<UserIdentity?, ClientProxyError>)?
4760+
4761+
func userIdentity(for userID: String) async -> Result<UserIdentity?, ClientProxyError> {
4762+
userIdentityForCallsCount += 1
4763+
userIdentityForReceivedUserID = userID
4764+
DispatchQueue.main.async {
4765+
self.userIdentityForReceivedInvocations.append(userID)
4766+
}
4767+
if let userIdentityForClosure = userIdentityForClosure {
4768+
return await userIdentityForClosure(userID)
4769+
} else {
4770+
return userIdentityForReturnValue
4771+
}
4772+
}
47034773
//MARK: - loadMediaContentForSource
47044774

47054775
var loadMediaContentForSourceThrowableError: Error?

0 commit comments

Comments
 (0)