Skip to content

Commit

Permalink
Show a verification badge on the Room Member/User Profile screens. (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
pixlwave and stefanceriu authored Oct 21, 2024
1 parent a0c81cf commit a4ea552
Show file tree
Hide file tree
Showing 50 changed files with 522 additions and 275 deletions.
6 changes: 5 additions & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@
C76892321558E75101E68ED6 /* ReadableFrameModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398817652FA8ABAE0A31AC6D /* ReadableFrameModifier.swift */; };
C7774720A4B2E34693E3227C /* RoomNotificationSettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8896CDD20CA2D87EA3B848A1 /* RoomNotificationSettingsScreen.swift */; };
C7ABEBECDC513F7887DACF66 /* ProgressMaskModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68010886142843705E342645 /* ProgressMaskModifier.swift */; };
C7B07EBA0F12B5912DA9BB97 /* UserIdentitySDKMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */; };
C80E06ED97CE52704A46C148 /* ClientBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1C33355FFB0F0953C35036 /* ClientBuilder.swift */; };
C85C7A201E4CFDA477ACEBEB /* AppLockSetupSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8610C1D21565C950BCA6A454 /* AppLockSetupSettingsScreenViewModelProtocol.swift */; };
C8A9C595038AFA2D707AC8C1 /* NotificationPermissionsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20E69F67D2A70ABD08CA6D54 /* NotificationPermissionsScreenViewModelProtocol.swift */; };
Expand Down Expand Up @@ -2221,6 +2222,7 @@
E8A1F98AE670377B20679FF5 /* MediaPlayerProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayerProvider.swift; sourceTree = "<group>"; };
E8AE4B3273BA189FDCD4055C /* UserIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicator.swift; sourceTree = "<group>"; };
E8CA187FE656EE5A3F6C7DE5 /* UIFont+AttributedStringBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIFont+AttributedStringBuilder.m"; sourceTree = "<group>"; };
E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIdentitySDKMock.swift; sourceTree = "<group>"; };
E96ED747FF90332EA1333C22 /* RoomTimelineItemFixtures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemFixtures.swift; sourceTree = "<group>"; };
E992D7B8BE54B2AB454613AF /* XCUIElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCUIElement.swift; sourceTree = "<group>"; };
E9A3D3CFA199FA7897364547 /* CallInviteRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInviteRoomTimelineItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5276,6 +5278,7 @@
isa = PBXGroup;
children = (
8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */,
E8DE9D0D480D087D0F676B52 /* UserIdentitySDKMock.swift */,
);
path = SDK;
sourceTree = "<group>";
Expand Down Expand Up @@ -7007,6 +7010,7 @@
828EA5009557C2B9DCD4CA0F /* UserDiscoverySection.swift in Sources */,
044DD8F80231BC30570F7965 /* UserDiscoveryService.swift in Sources */,
1C409A26A99F0371C47AFA51 /* UserDiscoveryServiceProtocol.swift in Sources */,
C7B07EBA0F12B5912DA9BB97 /* UserIdentitySDKMock.swift in Sources */,
988BA75A182738150894A23F /* UserIndicator.swift in Sources */,
C4E0D03DF88242697545A9B7 /* UserIndicatorController.swift in Sources */,
3467FEE8210D301FF1B77001 /* UserIndicatorControllerMock.swift in Sources */,
Expand Down Expand Up @@ -7818,7 +7822,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.0.58;
version = 1.0.59;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "753c5381ce88b3549cbd8ed9b839109ff143ecdd",
"version" : "1.0.58"
"revision" : "acd36f68f107f608c33b4d5b46be4ddea5537b1f",
"version" : "1.0.59"
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions ElementX/Sources/Mocks/ClientProxyMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,7 @@ extension ClientProxyMock {

return await .joined(JoinedRoomProxyMock(.init(id: room.id, name: room.name)))
}

userIdentityForReturnValue = .success(UserIdentitySDKMock(configuration: .init()))
}
}
70 changes: 70 additions & 0 deletions ElementX/Sources/Mocks/Generated/GeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4700,6 +4700,76 @@ class ClientProxyMock: ClientProxyProtocol {
return resetIdentityReturnValue
}
}
//MARK: - userIdentity

var userIdentityForUnderlyingCallsCount = 0
var userIdentityForCallsCount: Int {
get {
if Thread.isMainThread {
return userIdentityForUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = userIdentityForUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
userIdentityForUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
userIdentityForUnderlyingCallsCount = newValue
}
}
}
}
var userIdentityForCalled: Bool {
return userIdentityForCallsCount > 0
}
var userIdentityForReceivedUserID: String?
var userIdentityForReceivedInvocations: [String] = []

var userIdentityForUnderlyingReturnValue: Result<UserIdentity?, ClientProxyError>!
var userIdentityForReturnValue: Result<UserIdentity?, ClientProxyError>! {
get {
if Thread.isMainThread {
return userIdentityForUnderlyingReturnValue
} else {
var returnValue: Result<UserIdentity?, ClientProxyError>? = nil
DispatchQueue.main.sync {
returnValue = userIdentityForUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
userIdentityForUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
userIdentityForUnderlyingReturnValue = newValue
}
}
}
}
var userIdentityForClosure: ((String) async -> Result<UserIdentity?, ClientProxyError>)?

func userIdentity(for userID: String) async -> Result<UserIdentity?, ClientProxyError> {
userIdentityForCallsCount += 1
userIdentityForReceivedUserID = userID
DispatchQueue.main.async {
self.userIdentityForReceivedInvocations.append(userID)
}
if let userIdentityForClosure = userIdentityForClosure {
return await userIdentityForClosure(userID)
} else {
return userIdentityForReturnValue
}
}
//MARK: - loadMediaContentForSource

var loadMediaContentForSourceThrowableError: Error?
Expand Down
Loading

0 comments on commit a4ea552

Please sign in to comment.