Skip to content
Snippets Groups Projects
Commit a8a7ee40 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

call: fix hosting conferences

Change-Id: I228ae2f805fdb0b49c57d28ed1c0a625746b380e
parent 7916b4bd
No related branches found
No related tags found
No related merge requests found
......@@ -192,8 +192,7 @@ class CallPresenter @Inject constructor(
}
private fun showConference(conference: Observable<Conference>) {
var conference = conference
conference = conference.distinctUntilChanged()
val conference = conference.distinctUntilChanged()
mCompositeDisposable.add(conference
.switchMap { obj: Conference -> obj.participantInfo }
.observeOn(mUiScheduler)
......@@ -608,7 +607,7 @@ class CallPresenter @Inject constructor(
.filter(Call::isOnGoing)
.firstElement()
.delay(1, TimeUnit.SECONDS)
.doOnEvent { v: Call, e: Throwable -> pendingObserver.onComplete() }
.doOnEvent { v: Call?, e: Throwable? -> pendingObserver.onComplete() }
mCompositeDisposable.add(newCall.subscribe { call: Call ->
val id = mConference!!.id
if (mConference!!.isConference) {
......
......@@ -122,8 +122,10 @@ class Conference {
}
fun findCallByContact(uri: Uri): Call? {
val mUri = if (uri.host == "ring.dht") Uri.fromId(uri.rawRingId) else uri
for (call in mParticipants) {
if (call.contact!!.uri.toString() == uri.toString()) return call
if (call.contact?.uri == mUri)
return call
}
return null
}
......
......@@ -95,6 +95,8 @@ class CallService(
val newInfo: MutableList<ParticipantInfo> = ArrayList(info.size)
if (conference.isConference) {
for (i in info) {
val uri = i["uri"]!!
if (uri.isEmpty()) continue
val call = conference.findCallByContact(Uri.fromString(i["uri"]!!))
if (call != null) {
val confInfo = ParticipantInfo(call, call.contact!!, i)
......@@ -128,7 +130,7 @@ class CallService(
conference.isModerator = isModerator
conference.setInfo(newInfo)
} else {
Log.w(TAG, "onConferenceInfoUpdated can't find conference$confId")
Log.w(TAG, "onConferenceInfoUpdated can't find conference $confId")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment