mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Tapping on user avatar/name in the timeline opens the room member details (#1020)
* Implementation completed * changelog * code improvement * Apply suggestions from code review Co-authored-by: Stefan Ceriu <stefanc@matrix.org> * pr suggestions --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -23,7 +23,7 @@ enum RoomMemberProxyError: Error {
|
||||
}
|
||||
|
||||
// sourcery: AutoMockable
|
||||
protocol RoomMemberProxyProtocol {
|
||||
protocol RoomMemberProxyProtocol: AnyObject {
|
||||
var userID: String { get }
|
||||
var displayName: String? { get }
|
||||
var avatarURL: URL? { get }
|
||||
|
||||
@@ -389,6 +389,22 @@ class RoomProxy: RoomProxyProtocol {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func getMember(userID: String) async -> Result<RoomMemberProxyProtocol, RoomProxyError> {
|
||||
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
|
||||
defer {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
return await Task.dispatch(on: userInitiatedDispatchQueue) {
|
||||
do {
|
||||
let member = try self.room.member(userId: userID)
|
||||
return .success(RoomMemberProxy(member: member, backgroundTaskService: self.backgroundTaskService))
|
||||
} catch {
|
||||
return .failure(.failedRetrievingMember)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreUser(_ userID: String) async -> Result<Void, RoomProxyError> {
|
||||
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
|
||||
|
||||
@@ -33,6 +33,7 @@ enum RoomProxyError: Error {
|
||||
case failedReportingContent
|
||||
case failedAddingTimelineListener
|
||||
case failedRetrievingMembers
|
||||
case failedRetrievingMember
|
||||
case failedLeavingRoom
|
||||
case failedAcceptingInvite
|
||||
case failedRejectingInvite
|
||||
@@ -113,7 +114,9 @@ protocol RoomProxyProtocol {
|
||||
func leaveRoom() async -> Result<Void, RoomProxyError>
|
||||
|
||||
func updateMembers() async
|
||||
|
||||
|
||||
func getMember(userID: String) async -> Result<RoomMemberProxyProtocol, RoomProxyError>
|
||||
|
||||
func inviter() async -> RoomMemberProxyProtocol?
|
||||
|
||||
func rejectInvitation() async -> Result<Void, RoomProxyError>
|
||||
|
||||
Reference in New Issue
Block a user