mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Invite: we shouldn't be able to open room details
This commit is contained in:
parent
9c595b6c02
commit
8814364497
2 changed files with 19 additions and 11 deletions
|
@ -293,6 +293,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
setupJumpToBottomView()
|
||||
setupWidgetsBannerView()
|
||||
|
||||
roomToolbarContentView.isClickable = false
|
||||
roomToolbarContentView.debouncedClicks {
|
||||
navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId)
|
||||
}
|
||||
|
@ -858,6 +859,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
val summary = state.asyncRoomSummary()
|
||||
val inviter = state.asyncInviter()
|
||||
if (summary?.membership == Membership.JOIN) {
|
||||
roomToolbarContentView.isClickable = true
|
||||
roomWidgetsBannerView.render(state.activeRoomWidgets())
|
||||
scrollOnHighlightedEventCallback.timeline = roomDetailViewModel.timeline
|
||||
timelineEventController.update(state)
|
||||
|
@ -879,6 +881,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
notificationAreaView.render(NotificationAreaView.State.Tombstone(state.tombstoneEvent))
|
||||
}
|
||||
} else if (summary?.membership == Membership.INVITE && inviter != null) {
|
||||
roomToolbarContentView.isClickable = false
|
||||
inviteView.visibility = View.VISIBLE
|
||||
inviteView.render(inviter, VectorInviteView.Mode.LARGE)
|
||||
// Intercept click event
|
||||
|
|
|
@ -405,7 +405,11 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
|
||||
private fun isIntegrationEnabled() = session.integrationManagerService().isIntegrationEnabled()
|
||||
|
||||
fun isMenuItemVisible(@IdRes itemId: Int) = when (itemId) {
|
||||
fun isMenuItemVisible(@IdRes itemId: Int): Boolean = com.airbnb.mvrx.withState(this) { state ->
|
||||
if(state.asyncRoomSummary()?.membership != Membership.JOIN){
|
||||
return@withState false
|
||||
}
|
||||
when (itemId) {
|
||||
R.id.clear_message_queue ->
|
||||
// For now always disable when not in developer mode, worker cancellation is not working properly
|
||||
timeline.pendingEventCount() > 0 && vectorPreferences.developerMode()
|
||||
|
@ -417,6 +421,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
R.id.hangup_call -> webRtcPeerConnectionManager.currentCall != null
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
// PRIVATE METHODS *****************************************************************************
|
||||
|
||||
|
|
Loading…
Reference in a new issue