mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-10 08:00:57 +00:00
Update kotlin usage of okhttp due to bump 3.x->4.xwhich is binary compatible but not source compatible
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
6326268793
commit
7a574285db
@ -1267,7 +1267,7 @@ class ChatController(args: Bundle) :
|
||||
val xChatLastCommonRead = response.headers().get("X-Chat-Last-Common-Read")?.let {
|
||||
Integer.parseInt(it)
|
||||
}
|
||||
if (response.headers().size() > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
|
||||
if (response.headers().size > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
|
||||
|
||||
val header = Integer.parseInt(xChatLastGivenHeader!!)
|
||||
if (header > 0) {
|
||||
|
@ -54,8 +54,8 @@ import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.RequestBody
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import javax.inject.Inject
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
@ -122,7 +122,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
ncApi.searchContactsByPhoneNumber(
|
||||
ApiUtils.getCredentials(currentUser.username, currentUser.token),
|
||||
ApiUtils.getUrlForSearchByNumber(currentUser.baseUrl),
|
||||
RequestBody.create(MediaType.parse("application/json"), json)
|
||||
json.toRequestBody("application/json".toMediaTypeOrNull())
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
@ -44,7 +44,7 @@ import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.RequestBody
|
||||
import retrofit2.Response
|
||||
import java.io.File
|
||||
@ -103,7 +103,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
||||
val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
|
||||
val buf = ByteArray(input.available())
|
||||
while (input.read(buf) != -1);
|
||||
requestBody = RequestBody.create(MediaType.parse("application/octet-stream"), buf)
|
||||
requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), buf)
|
||||
} catch (e: Exception) {
|
||||
Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user