Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-android
Commits
bb32dd3a
Commit
bb32dd3a
authored
Sep 30, 2021
by
Adrien Béraud
Browse files
home activity: fix opening conversation from notification
Change-Id: I492e5c9b77267333db05175db97d3b8618c82515
parent
b57104ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
ring-android/app/src/main/java/cx/ring/client/HomeActivity.kt
View file @
bb32dd3a
...
...
@@ -174,23 +174,27 @@ class HomeActivity : AppCompatActivity(), NavigationBarView.OnItemSelectedListen
Log
.
d
(
TAG
,
"handleIntent: $intent"
)
val
extra
=
intent
.
extras
val
action
=
intent
.
action
if
(
ACTION_PRESENT_TRUST_REQUEST_FRAGMENT
==
action
)
{
//mAccountWithPendingrequests = extra.getString(ContactRequestsFragment.ACCOUNT_ID);
presentTrustRequestFragment
(
extra
?.
getString
(
AccountEditionFragment
.
ACCOUNT_ID_KEY
)
?:
return
)
}
else
if
(
Intent
.
ACTION_SEND
==
action
||
Intent
.
ACTION_SEND_MULTIPLE
==
action
)
{
val
path
=
ConversationPath
.
fromBundle
(
extra
)
if
(
path
!=
null
)
{
startConversation
(
path
)
}
else
{
intent
.
setClass
(
applicationContext
,
ShareActivity
::
class
.
java
)
startActivity
(
intent
)
when
(
action
)
{
ACTION_PRESENT_TRUST_REQUEST_FRAGMENT
->
{
presentTrustRequestFragment
(
extra
?.
getString
(
AccountEditionFragment
.
ACCOUNT_ID_KEY
)
?:
return
)
}
Intent
.
ACTION_SEND
,
Intent
.
ACTION_SEND_MULTIPLE
->
{
val
path
=
ConversationPath
.
fromBundle
(
extra
)
if
(
path
!=
null
)
{
startConversation
(
path
)
}
else
{
intent
.
setClass
(
applicationContext
,
ShareActivity
::
class
.
java
)
startActivity
(
intent
)
}
}
}
else
if
(
DRingService
.
ACTION_CONV_ACCEPT
==
action
||
Intent
.
ACTION_VIEW
==
action
)
{
val
path
=
ConversationPath
.
fromBundle
(
extra
)
if
(
path
!=
null
)
{
startConversation
(
path
)
Intent
.
ACTION_VIEW
,
DRingService
.
ACTION_CONV_ACCEPT
->
{
val
path
=
ConversationPath
.
fromIntent
(
intent
)
if
(
path
!=
null
)
startConversation
(
path
)
}
}
//else {
}
val
fragmentManager
=
supportFragmentManager
fContent
=
fragmentManager
.
findFragmentById
(
R
.
id
.
main_frame
)
if
(
fContent
==
null
||
Intent
.
ACTION_SEARCH
==
action
)
{
...
...
ring-android/app/src/main/java/cx/ring/utils/ConversationPath.kt
View file @
bb32dd3a
...
...
@@ -165,8 +165,9 @@ class ConversationPath {
if
(
accountId
!=
null
&&
contactId
!=
null
)
{
return
ConversationPath
(
accountId
,
contactId
)
}
else
{
val
shortcutId
=
bundle
.
getString
(
ShortcutManagerCompat
.
EXTRA_SHORTCUT_ID
)
if
(
shortcutId
!=
null
)
return
fromKey
(
shortcutId
)
bundle
.
getString
(
ShortcutManagerCompat
.
EXTRA_SHORTCUT_ID
)
?.
let
{
shortcutId
->
return
fromKey
(
shortcutId
)
}
}
}
return
null
...
...
@@ -174,9 +175,7 @@ class ConversationPath {
fun
fromIntent
(
intent
:
Intent
?):
ConversationPath
?
{
if
(
intent
!=
null
)
{
val
uri
=
intent
.
data
val
conversationPath
=
fromUri
(
uri
)
return
conversationPath
?:
fromBundle
(
intent
.
extras
)
return
fromUri
(
intent
.
data
)
?:
fromBundle
(
intent
.
extras
)
}
return
null
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment