mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Fix to deeply nested function processHeaderChatLastGiven
Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
5bb63fd58d
commit
d0df4039c6
@ -2486,17 +2486,23 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
private fun processHeaderChatLastGiven(response: Response<*>, isFromTheFuture: Boolean) {
|
private fun processHeaderChatLastGiven(response: Response<*>, isFromTheFuture: Boolean) {
|
||||||
val xChatLastGivenHeader: String? = response.headers()["X-Chat-Last-Given"]
|
val xChatLastGivenHeader: String? = response.headers()["X-Chat-Last-Given"]
|
||||||
if (response.headers().size > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
|
|
||||||
val header = Integer.parseInt(xChatLastGivenHeader!!)
|
val header = if (response.headers().size > 0 &&
|
||||||
if (header > 0) {
|
xChatLastGivenHeader?.isNotEmpty() == true
|
||||||
if (isFromTheFuture) {
|
) {
|
||||||
|
xChatLastGivenHeader.toInt()
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (header > 0) {
|
||||||
|
if (isFromTheFuture) {
|
||||||
|
globalLastKnownFutureMessageId = header
|
||||||
|
} else {
|
||||||
|
if (globalLastKnownFutureMessageId == -1) {
|
||||||
globalLastKnownFutureMessageId = header
|
globalLastKnownFutureMessageId = header
|
||||||
} else {
|
|
||||||
if (globalLastKnownFutureMessageId == -1) {
|
|
||||||
globalLastKnownFutureMessageId = header
|
|
||||||
}
|
|
||||||
globalLastKnownPastMessageId = header
|
|
||||||
}
|
}
|
||||||
|
globalLastKnownPastMessageId = header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user