mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-06 20:39:47 +01:00
Handle link of the same domain
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
1cdb491c7f
commit
65e7109d28
@ -154,7 +154,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".chat.ChatActivity"
|
android:name=".chat.ChatActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/AppTheme" >
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
<intent-filter android:autoVerify="true">
|
<intent-filter android:autoVerify="true">
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
@ -163,9 +163,8 @@
|
|||||||
<data android:scheme="http"/>
|
<data android:scheme="http"/>
|
||||||
<data android:scheme="https"/>
|
<data android:scheme="https"/>
|
||||||
<data android:host="*"/>
|
<data android:host="*"/>
|
||||||
<data android:pathPrefix="/index.php/call/..*"/>
|
<data android:pathPattern="/index.php/call/..*"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
@ -569,6 +569,26 @@ class ChatActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleIntent(intent: Intent) {
|
private fun handleIntent(intent: Intent) {
|
||||||
|
val appLinkAction = intent.action
|
||||||
|
val appLinkData: Uri? = intent.data
|
||||||
|
val sharedLink = appLinkData.toString()
|
||||||
|
val roomPathPrefix1 = "${conversationUser?.baseUrl}/call"
|
||||||
|
val roomPathPrefix2 = "${conversationUser?.baseUrl}/index.php/call"
|
||||||
|
val isValidPrefix = sharedLink.contains(roomPathPrefix1, ignoreCase = true) ||
|
||||||
|
sharedLink.contains(roomPathPrefix2, ignoreCase = true)
|
||||||
|
if (appLinkAction == Intent.ACTION_VIEW && isValidPrefix) {
|
||||||
|
appLinkData?.let { linkUri ->
|
||||||
|
val host = linkUri.host
|
||||||
|
val roomToken = linkUri.lastPathSegment
|
||||||
|
val bundle = Bundle()
|
||||||
|
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
||||||
|
bundle.putString(BundleKeys.KEY_BASE_URL, host)
|
||||||
|
val chatIntent = Intent(context, ChatActivity::class.java)
|
||||||
|
chatIntent.putExtras(bundle)
|
||||||
|
startActivity(chatIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val extras: Bundle? = intent.extras
|
val extras: Bundle? = intent.extras
|
||||||
|
|
||||||
roomId = extras?.getString(KEY_ROOM_ID).orEmpty()
|
roomId = extras?.getString(KEY_ROOM_ID).orEmpty()
|
||||||
|
Loading…
Reference in New Issue
Block a user