Knock Requests banner display logic (#3550)

* added the join rule to the info

* update SDK and added logic to display the banner

in the room screen

* added the logic to display the banner
This commit is contained in:
Mauro
2024-11-25 13:14:02 +01:00
committed by GitHub
parent 9180bac13c
commit 26e07f2457
16 changed files with 131 additions and 42 deletions
@@ -39,6 +39,18 @@ struct RoomScreenViewState: BindableState {
var hasOngoingCall: Bool
var shouldShowCallButton = true
var isKnockingEnabled = false
var isKnockableRoom = false
var canAcceptKnocks = false
var canDeclineKnocks = false
var canBan = false
// TODO: We still don't know how to get these, but these will be the non already seen knock requests of the room, for now we are using this as a mock for testing purposes
var unseenKnockRequests: [KnockRequestInfo] = [.init(displayName: "Alice", avatarURL: nil, userID: "@alice:matrix.org", reason: "Helloooo")]
var shouldSeeKnockRequests: Bool {
isKnockingEnabled && isKnockableRoom && !unseenKnockRequests.isEmpty && (canAcceptKnocks || canDeclineKnocks || canBan)
}
var footerDetails: RoomScreenFooterViewDetails?
var bindings: RoomScreenViewStateBindings