Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-02-26 11:09:56 +01:00
parent 2763283ef0
commit 01ff371f35
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
4 changed files with 4 additions and 45 deletions

View File

@ -84,45 +84,4 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent
incomingCallIntent.putExtra(BundleKeys.KEY_ENCRYPTED_SIGNATURE, remoteMessage.data["signature"])
applicationContext.startService(incomingCallIntent)
}
@SuppressLint("LongLogTag")
private fun checkIfCallIsActive(signatureVerification: SignatureVerification, decryptedPushMessage: DecryptedPushMessage) {
/*val ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(JavaNetCookieJar(CookieManager())).build()).build().create(NcApi::class.java)
var hasParticipantsInCall = false
var inCallOnDifferentDevice = false
ncApi.getPeersForCall(ApiUtils.getCredentials(signatureVerification.userEntity.username, signatureVerification.userEntity.token),
ApiUtils.getUrlForParticipants(signatureVerification.userEntity.baseUrl,
decryptedPushMessage.id))
.subscribeOn(Schedulers.io())
.subscribe(object : Observer<ParticipantsOverall> {
override fun onSubscribe(d: Disposable) {
}
override fun onNext(participantsOverall: ParticipantsOverall) {
val participantList: List<Participant> = participantsOverall.ocs.data
for (participant in participantList) {
if (participant.participantFlags != Participant.ParticipantFlags.NOT_IN_CALL) {
hasParticipantsInCall = true
if (participant.userId == signatureVerification.userEntity.userId) {
inCallOnDifferentDevice = true
break
}
}
}
if (!hasParticipantsInCall || inCallOnDifferentDevice) {
stopForeground(true)
} else if (isServiceInForeground) {
checkIfCallIsActive(signatureVerification, decryptedPushMessage)
}
}
override fun onError(e: Throwable) {}
override fun onComplete() {
}
})*/
}
}

View File

@ -39,7 +39,7 @@ import java.util.*
@Serializable
@Entity(tableName = "users")
data class UserNgEntity(
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") var id: Long = 0,
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") var id: Long,
@ColumnInfo(name = "user_id") var userId: String,
@ColumnInfo(name = "username") var username: String,
@ColumnInfo(name = "base_url") var baseUrl: String,

View File

@ -36,7 +36,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-alpha09'
classpath 'com.android.tools.build:gradle:4.0.0-beta01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

View File

@ -1,6 +1,6 @@
#Thu Jan 30 21:22:08 CET 2020
#Wed Feb 26 11:00:50 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip