mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add support for joining rooms from a space. (#4501)
* Add support for joining rooms from a space.
Doesn't yet handle the Join button 🤔
* Handle the join button for both rooms and spaces.
Also refactor more instances of spaceRoom to spaceRoomProxy.
This commit is contained in:
@@ -542,6 +542,17 @@ class ClientProxy: ClientProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func canJoinRoom(with rules: [AllowRule]) -> Bool {
|
||||
for rule in rules {
|
||||
if case let .roomMembership(roomID) = rule,
|
||||
let room = try? client.getRoom(roomId: roomID),
|
||||
room.membership() == .joined {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func uploadMedia(_ media: MediaInfo) async -> Result<String, ClientProxyError> {
|
||||
guard let mimeType = media.mimeType else {
|
||||
MXLog.error("Failed uploading media, invalid mime type: \(media)")
|
||||
|
||||
@@ -165,6 +165,8 @@ protocol ClientProxyProtocol: AnyObject {
|
||||
|
||||
func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result<Void, ClientProxyError>
|
||||
|
||||
func canJoinRoom(with rules: [AllowRule]) -> Bool
|
||||
|
||||
func uploadMedia(_ media: MediaInfo) async -> Result<String, ClientProxyError>
|
||||
|
||||
func roomForIdentifier(_ identifier: String) async -> RoomProxyType?
|
||||
|
||||
Reference in New Issue
Block a user