diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 815d745d31..acb6940806 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -21,7 +21,7 @@ ext.versions = [ 'okhttp' : '4.10.0', 'sqlDelight' : '1.5.4', 'toplAndroid': '2.1.2', - 'targetSdk' : 33 + 'targetSdk' : 30 ] /** diff --git a/sphinx/activity/main/activitymain/src/main/AndroidManifest.xml b/sphinx/activity/main/activitymain/src/main/AndroidManifest.xml index 194fd160c2..87a93655ec 100644 --- a/sphinx/activity/main/activitymain/src/main/AndroidManifest.xml +++ b/sphinx/activity/main/activitymain/src/main/AndroidManifest.xml @@ -16,7 +16,6 @@ android:windowSoftInputMode="adjustPan"> - @@ -25,6 +24,13 @@ + + + + + + + diff --git a/sphinx/screens/dashboard/dashboard/build.gradle b/sphinx/screens/dashboard/dashboard/build.gradle index c8f478c64f..8d18d00fe3 100644 --- a/sphinx/screens/dashboard/dashboard/build.gradle +++ b/sphinx/screens/dashboard/dashboard/build.gradle @@ -78,6 +78,7 @@ dependencies { implementation deps.jna.sdk implementation deps.lottie.sdk implementation deps.square.moshi + implementation deps.jitsi.sdk kapt kaptDeps.google.hilt testImplementation testDeps.junit diff --git a/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/DashboardViewModel.kt b/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/DashboardViewModel.kt index db4520edfb..a8056aaba9 100644 --- a/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/DashboardViewModel.kt +++ b/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/DashboardViewModel.kt @@ -58,6 +58,8 @@ import chat.sphinx.wrapper_common.dashboard.RestoreProgressViewState import chat.sphinx.wrapper_common.dashboard.toChatId import chat.sphinx.wrapper_common.feed.* import chat.sphinx.wrapper_common.lightning.* +import chat.sphinx.wrapper_common.message.SphinxCallLink +import chat.sphinx.wrapper_common.message.toSphinxCallLink import chat.sphinx.wrapper_common.tribe.TribeJoinLink import chat.sphinx.wrapper_common.tribe.isValidTribeJoinLink import chat.sphinx.wrapper_common.tribe.toTribeJoinLink @@ -76,6 +78,9 @@ import io.matthewnelson.concept_coroutines.CoroutineDispatchers import io.matthewnelson.concept_views.viewstate.ViewStateContainer import kotlinx.coroutines.* import kotlinx.coroutines.flow.* +import org.jitsi.meet.sdk.JitsiMeetActivity +import org.jitsi.meet.sdk.JitsiMeetConferenceOptions +import org.jitsi.meet.sdk.JitsiMeetUserInfo import javax.inject.Inject @HiltViewModel @@ -195,6 +200,37 @@ internal class DashboardViewModel @Inject constructor( handleFeedItemLink(feedItemLink) } ?: deepLink?.toPushNotificationLink()?.let { pushNotificationLink -> handlePushNotification(pushNotificationLink) + } ?: deepLink?.toSphinxCallLink()?.let { sphinxCallLink -> + joinCall(sphinxCallLink, sphinxCallLink.startAudioOnly) + } + } + } + + private fun joinCall(link: SphinxCallLink, audioOnly: Boolean) { + link.callServerUrl?.let { nnCallUrl -> + + viewModelScope.launch(mainImmediate) { + + val owner = getOwner() + + val userInfo = JitsiMeetUserInfo() + userInfo.displayName = owner.alias?.value ?: "" + + owner.avatarUrl?.let { nnAvatarUrl -> + userInfo.avatar = nnAvatarUrl + } + + val options = JitsiMeetConferenceOptions.Builder() + .setServerURL(nnCallUrl) + .setRoom(link.callRoom) + .setAudioMuted(false) + .setVideoMuted(false) + .setFeatureFlag("welcomepage.enabled", false) + .setAudioOnly(audioOnly) + .setUserInfo(userInfo) + .build() + + JitsiMeetActivity.launch(app, options) } } }