mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Merge pull request #5548 from vector-im/bugfix/eric/call-button-disappearing
Fixes voice call button disappearing in DM rooms with more than 2 members
This commit is contained in:
commit
9c333c96c4
5 changed files with 9 additions and 8 deletions
1
changelog.d/5548.bugfix
Normal file
1
changelog.d/5548.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fixes voice call button disappearing in DM rooms with more than 2 members
|
|
@ -88,7 +88,7 @@ import org.matrix.android.sdk.api.session.room.model.Membership
|
||||||
fun render(roomDetailViewState: RoomDetailViewState) {
|
fun render(roomDetailViewState: RoomDetailViewState) {
|
||||||
val summary = roomDetailViewState.asyncRoomSummary()
|
val summary = roomDetailViewState.asyncRoomSummary()
|
||||||
val newState = if (summary?.membership != Membership.JOIN ||
|
val newState = if (summary?.membership != Membership.JOIN ||
|
||||||
roomDetailViewState.isWebRTCCallOptionAvailable() ||
|
roomDetailViewState.isCallOptionAvailable() ||
|
||||||
!roomDetailViewState.isAllowedToManageWidgets ||
|
!roomDetailViewState.isAllowedToManageWidgets ||
|
||||||
roomDetailViewState.jitsiState.widgetId == null) {
|
roomDetailViewState.jitsiState.widgetId == null) {
|
||||||
State.Unmount
|
State.Unmount
|
||||||
|
|
|
@ -87,7 +87,7 @@ data class RoomDetailViewState(
|
||||||
rootThreadEventId = args.threadTimelineArgs?.rootThreadEventId
|
rootThreadEventId = args.threadTimelineArgs?.rootThreadEventId
|
||||||
)
|
)
|
||||||
|
|
||||||
fun isWebRTCCallOptionAvailable() = (asyncRoomSummary.invoke()?.joinedMembersCount ?: 0) <= 2
|
fun isCallOptionAvailable() = asyncRoomSummary.invoke()?.isDirect ?: true
|
||||||
|
|
||||||
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false
|
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false
|
||||||
|
|
||||||
|
|
|
@ -713,10 +713,10 @@ class TimelineViewModel @AssistedInject constructor(
|
||||||
R.id.timeline_setting -> true
|
R.id.timeline_setting -> true
|
||||||
R.id.invite -> state.canInvite
|
R.id.invite -> state.canInvite
|
||||||
R.id.open_matrix_apps -> true
|
R.id.open_matrix_apps -> true
|
||||||
R.id.voice_call -> state.isWebRTCCallOptionAvailable()
|
R.id.voice_call -> state.isCallOptionAvailable()
|
||||||
R.id.video_call -> state.isWebRTCCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined
|
R.id.video_call -> state.isCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined
|
||||||
// Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^
|
// Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^
|
||||||
R.id.join_conference -> !state.isWebRTCCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
|
R.id.join_conference -> !state.isCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
|
||||||
R.id.search -> state.isSearchAvailable()
|
R.id.search -> state.isSearchAvailable()
|
||||||
R.id.menu_timeline_thread_list -> vectorPreferences.areThreadMessagesEnabled()
|
R.id.menu_timeline_thread_list -> vectorPreferences.areThreadMessagesEnabled()
|
||||||
R.id.dev_tools -> vectorPreferences.developerMode()
|
R.id.dev_tools -> vectorPreferences.developerMode()
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
android:title="@string/action_video_call"
|
android:title="@string/action_video_call"
|
||||||
android:visible="false"
|
android:visible="false"
|
||||||
app:iconTint="?colorPrimary"
|
app:iconTint="?colorPrimary"
|
||||||
app:showAsAction="always"
|
app:showAsAction="ifRoom"
|
||||||
tools:visible="true" />
|
tools:visible="true" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
android:title="@string/call"
|
android:title="@string/call"
|
||||||
android:visible="false"
|
android:visible="false"
|
||||||
app:iconTint="?colorPrimary"
|
app:iconTint="?colorPrimary"
|
||||||
app:showAsAction="always"
|
app:showAsAction="ifRoom"
|
||||||
tools:visible="true" />
|
tools:visible="true" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
android:visible="false"
|
android:visible="false"
|
||||||
app:iconTint="?colorPrimary"
|
app:iconTint="?colorPrimary"
|
||||||
app:actionLayout="@layout/view_thread_notification_badge"
|
app:actionLayout="@layout/view_thread_notification_badge"
|
||||||
app:showAsAction="always"
|
app:showAsAction="ifRoom"
|
||||||
tools:visible="true" />
|
tools:visible="true" />
|
||||||
|
|
||||||
<item android:id="@+id/join_conference"
|
<item android:id="@+id/join_conference"
|
||||||
|
|
Loading…
Reference in a new issue