Add a menu item in the timeline as a shortcut to invite user (#2171)
This commit is contained in:
parent
6f2736566e
commit
ae3c453f35
@ -12,6 +12,7 @@ Improvements 🙌:
|
|||||||
- Allow user to reset cross signing if he has no way to recover (#2052)
|
- Allow user to reset cross signing if he has no way to recover (#2052)
|
||||||
- Create home shortcut for any room (#1525)
|
- Create home shortcut for any room (#1525)
|
||||||
- Add a menu item to open the setting in room list and in room (#2171)
|
- Add a menu item to open the setting in room list and in room (#2171)
|
||||||
|
- Add a menu item in the timeline as a shortcut to invite user (#2171)
|
||||||
|
|
||||||
Bugfix 🐛:
|
Bugfix 🐛:
|
||||||
- Improve support for image/audio/video/file selection with intent changes (#1376)
|
- Improve support for image/audio/video/file selection with intent changes (#1376)
|
||||||
|
@ -656,6 +656,10 @@ class RoomDetailFragment @Inject constructor(
|
|||||||
roomDetailViewModel.handle(RoomDetailAction.ClearSendQueue)
|
roomDetailViewModel.handle(RoomDetailAction.ClearSendQueue)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
R.id.invite -> {
|
||||||
|
navigator.openInviteUsersToRoom(requireActivity(), roomDetailArgs.roomId)
|
||||||
|
true
|
||||||
|
}
|
||||||
R.id.timeline_setting -> {
|
R.id.timeline_setting -> {
|
||||||
navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId)
|
navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId)
|
||||||
true
|
true
|
||||||
|
@ -180,11 +180,13 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||||||
PowerLevelsObservableFactory(room).createObservable()
|
PowerLevelsObservableFactory(room).createObservable()
|
||||||
.subscribe {
|
.subscribe {
|
||||||
val canSendMessage = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.MESSAGE)
|
val canSendMessage = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.MESSAGE)
|
||||||
|
val canInvite = PowerLevelsHelper(it).isUserAbleToInvite(session.myUserId)
|
||||||
val isAllowedToManageWidgets = session.widgetService().hasPermissionsToHandleWidgets(room.roomId)
|
val isAllowedToManageWidgets = session.widgetService().hasPermissionsToHandleWidgets(room.roomId)
|
||||||
val isAllowedToStartWebRTCCall = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.CALL_INVITE)
|
val isAllowedToStartWebRTCCall = PowerLevelsHelper(it).isUserAllowedToSend(session.myUserId, false, EventType.CALL_INVITE)
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
canSendMessage = canSendMessage,
|
canSendMessage = canSendMessage,
|
||||||
|
canInvite = canInvite,
|
||||||
isAllowedToManageWidgets = isAllowedToManageWidgets,
|
isAllowedToManageWidgets = isAllowedToManageWidgets,
|
||||||
isAllowedToStartWebRTCCall = isAllowedToStartWebRTCCall
|
isAllowedToStartWebRTCCall = isAllowedToStartWebRTCCall
|
||||||
)
|
)
|
||||||
@ -534,6 +536,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||||||
timeline.pendingEventCount() > 0 && vectorPreferences.developerMode()
|
timeline.pendingEventCount() > 0 && vectorPreferences.developerMode()
|
||||||
R.id.resend_all -> state.asyncRoomSummary()?.hasFailedSending == true
|
R.id.resend_all -> state.asyncRoomSummary()?.hasFailedSending == true
|
||||||
R.id.timeline_setting -> true
|
R.id.timeline_setting -> true
|
||||||
|
R.id.invite -> state.canInvite
|
||||||
R.id.clear_all -> state.asyncRoomSummary()?.hasFailedSending == true
|
R.id.clear_all -> state.asyncRoomSummary()?.hasFailedSending == true
|
||||||
R.id.open_matrix_apps -> true
|
R.id.open_matrix_apps -> true
|
||||||
R.id.voice_call,
|
R.id.voice_call,
|
||||||
|
@ -67,6 +67,7 @@ data class RoomDetailViewState(
|
|||||||
val canShowJumpToReadMarker: Boolean = true,
|
val canShowJumpToReadMarker: Boolean = true,
|
||||||
val changeMembershipState: ChangeMembershipState = ChangeMembershipState.Unknown,
|
val changeMembershipState: ChangeMembershipState = ChangeMembershipState.Unknown,
|
||||||
val canSendMessage: Boolean = true,
|
val canSendMessage: Boolean = true,
|
||||||
|
val canInvite: Boolean = true,
|
||||||
val isAllowedToManageWidgets: Boolean = false,
|
val isAllowedToManageWidgets: Boolean = false,
|
||||||
val isAllowedToStartWebRTCCall: Boolean = true
|
val isAllowedToStartWebRTCCall: Boolean = true
|
||||||
) : MvRxState {
|
) : MvRxState {
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
android:title="@string/search"
|
android:title="@string/search"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/invite"
|
||||||
|
android:title="@string/invite"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/video_call"
|
android:id="@+id/video_call"
|
||||||
android:icon="@drawable/ic_video"
|
android:icon="@drawable/ic_video"
|
||||||
|
Loading…
Reference in New Issue
Block a user