Remove unused parameter 'timeout' from 'ChatController#processMessages'

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2022-09-06 18:04:03 +02:00
parent 2d5969964d
commit f762d0c9e5
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -2182,7 +2182,6 @@ class ChatController(args: Bundle) :
} }
if (lookIntoFuture > 0) { if (lookIntoFuture > 0) {
val finalTimeout = timeout
Log.d(TAG, "pullChatMessages - pullChatMessages[lookIntoFuture > 0] - calling") Log.d(TAG, "pullChatMessages - pullChatMessages[lookIntoFuture > 0] - calling")
ncApi.pullChatMessages( ncApi.pullChatMessages(
credentials, credentials,
@ -2207,7 +2206,7 @@ class ChatController(args: Bundle) :
} else if (response.code() == HTTP_CODE_PRECONDITION_FAILED) { } else if (response.code() == HTTP_CODE_PRECONDITION_FAILED) {
futurePreconditionFailed = true futurePreconditionFailed = true
} else { } else {
processMessages(response, true, finalTimeout) processMessages(response, true)
} }
} catch (npe: NullPointerException) { } catch (npe: NullPointerException) {
// view binding can be null // view binding can be null
@ -2249,7 +2248,7 @@ class ChatController(args: Bundle) :
if (response.code() == HTTP_CODE_PRECONDITION_FAILED) { if (response.code() == HTTP_CODE_PRECONDITION_FAILED) {
pastPreconditionFailed = true pastPreconditionFailed = true
} else { } else {
processMessages(response, false, 0) processMessages(response, false)
} }
} catch (e: NullPointerException) { } catch (e: NullPointerException) {
// view binding can be null // view binding can be null
@ -2294,7 +2293,7 @@ class ChatController(args: Bundle) :
} }
} }
private fun processMessages(response: Response<*>, isFromTheFuture: Boolean, timeout: Int) { private fun processMessages(response: Response<*>, isFromTheFuture: Boolean) {
val xChatLastGivenHeader: String? = response.headers()["X-Chat-Last-Given"] val xChatLastGivenHeader: String? = response.headers()["X-Chat-Last-Given"]
val xChatLastCommonRead = response.headers()["X-Chat-Last-Common-Read"]?.let { val xChatLastCommonRead = response.headers()["X-Chat-Last-Common-Read"]?.let {
Integer.parseInt(it) Integer.parseInt(it)