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
09d49bcf
Commit
09d49bcf
authored
Sep 30, 2021
by
Adrien Béraud
Browse files
conversation facade: handle call from unknown swarm
Change-Id: I5f3329fa41aab4a938fdb4227ce3a1892adcffc9
parent
bb32dd3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
ring-android/libjamiclient/src/main/kotlin/net/jami/services/ConversationFacade.kt
View file @
09d49bcf
...
...
@@ -21,6 +21,7 @@
package
net.jami.services
import
io.reactivex.rxjava3.core.Completable
import
io.reactivex.rxjava3.core.Maybe
import
io.reactivex.rxjava3.core.Observable
import
io.reactivex.rxjava3.core.Single
import
io.reactivex.rxjava3.disposables.CompositeDisposable
...
...
@@ -497,9 +498,9 @@ class ConversationFacade(
if
(
contact
==
null
)
null
else
account
.
getByUri
(
contact
.
conversationUri
.
blockingFirst
())
account
.
getByUri
(
contact
.
conversationUri
.
blockingFirst
())
?:
account
.
getByUri
(
contact
.
uri
)
else
account
.
get
Swarm
(
conversationId
)
account
.
get
ByUri
(
Uri
(
Uri
.
SWARM_SCHEME
,
conversationId
)
)
val
conference
=
if
(
conversation
!=
null
)
(
conversation
.
getConference
(
call
.
daemonIdString
)
?:
Conference
(
call
).
apply
{
if
(
newState
===
CallStatus
.
OVER
)
return
@onCallStateChange
conversation
.
addConference
(
this
)
...
...
@@ -658,13 +659,14 @@ class ConversationFacade(
}.
subscribe
())
})
mDisposableBag
.
add
(
mAccountService
.
messageStateChanges
.
concatMap
Singl
e
{
e
:
Interaction
->
.
concatMap
Mayb
e
{
e
:
Interaction
->
getAccountSubject
(
e
.
account
!!
)
.
map
{
a
:
Account
->
if
(
e
.
conversation
==
null
)
a
.
getByUri
(
Uri
(
Uri
.
SWARM_SCHEME
,
e
.
conversationId
!!
))
!!
else
a
.
getByUri
(
e
.
conversation
!!
.
participant
)
!!
.
flatMapMaybe
<
Conversation
>
{
a
:
Account
->
Maybe
.
fromCallable
{
if
(
e
.
conversation
==
null
)
a
.
getByUri
(
Uri
(
Uri
.
SWARM_SCHEME
,
e
.
conversationId
!!
))
else
a
.
getByUri
(
e
.
conversation
!!
.
participant
)
}
}
.
doOnSuccess
{
conversation
->
conversation
.
updateInteraction
(
e
)
}
}
...
...
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