Kindof works I guess

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-05-03 17:05:01 +02:00
parent 7102f4ea54
commit 34d0b14ab0
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
2 changed files with 4 additions and 6 deletions

View File

@ -115,7 +115,7 @@ fun createOkHttpClient(
): OkHttpClient {
val httpClient = OkHttpClient.Builder()
httpClient.retryOnConnectionFailure(true)
httpClient.retryOnConnectionFailure(false)
httpClient.connectTimeout(300, TimeUnit.SECONDS)
httpClient.readTimeout(300, TimeUnit.SECONDS)
httpClient.writeTimeout(300, TimeUnit.SECONDS)
@ -125,7 +125,6 @@ fun createOkHttpClient(
// Trust own CA and all self-signed certs
httpClient.sslSocketFactory(sslSocketFactory, magicTrustManager)
httpClient.retryOnConnectionFailure(true)
httpClient.hostnameVerifier(magicTrustManager.getHostnameVerifier(OkHostnameVerifier.INSTANCE))
if (SDK_INT == Build.VERSION_CODES.N) {

View File

@ -102,11 +102,10 @@ class GlobalService constructor(usersRepository: UsersRepository,
chatMessage.let { chatMessage ->
conversation?.let { conversation ->
val currentStatus = chatMessage.chatMessageStatus
applicationScope.launch {
//messagesRepository.updateMessageStatus(ChatMessageStatus.PROCESSING.ordinal, conversation.databaseId!!, chatMessage.jsonMessageId!!)
}
currentUser?.let { user ->
val currentStatus = chatMessage.chatMessageStatus
messagesRepository.updateMessageStatus(ChatMessageStatus.PROCESSING.ordinal, conversation.databaseId!!, chatMessage.jsonMessageId!!)
if (chatMessage.internalConversationId == conversation.databaseId && conversation.databaseUserId == currentUser.id) {
val sendChatMessageUseCase = SendChatMessageUseCase(networkComponents.getRepository(false, user), ApiErrorHandler())
val messageToSend = ChatUtils.getParsedMessageForSending(chatMessage.message, chatMessage.messageParameters)