Skip to content

Commit

Permalink
fixed chat not updating
Browse files Browse the repository at this point in the history
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
  • Loading branch information
rapterjet2004 committed May 29, 2024
1 parent 8d9ecef commit 1c8d25b
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,6 @@ class ChatActivity :
checkShowMessageInputView()
checkLobbyState()
updateRoomTimerHandler()

chatViewModel.refreshChatParams(
setupFieldsForPullChatMessages(
false,
0,
false
)
)
}

is ChatViewModel.GetCapabilitiesInitialLoadState -> {
Expand Down Expand Up @@ -773,15 +765,19 @@ class ChatActivity :
val chatOverall = state.response.body() as ChatOverall?
var chatMessageList = chatOverall?.ocs!!.data!!

val newXChatLastCommonRead = state.response.headers()["X-Chat-Last-Common-Read"]?.let {
Integer.parseInt(it)
}

processHeaderChatLastGiven(state.response, state.lookIntoFuture)

chatMessageList = handleSystemMessages(chatMessageList)

if (chatMessageList.size == 0) {
if (chatMessageList.isEmpty()) {
chatViewModel.refreshChatParams(
setupFieldsForPullChatMessages(
true,
globalLastKnownFutureMessageId,
newXChatLastCommonRead,
true
)
)
Expand Down Expand Up @@ -813,10 +809,6 @@ class ChatActivity :
collapseSystemMessages()
}

val newXChatLastCommonRead = state.response.headers()["X-Chat-Last-Common-Read"]?.let {
Integer.parseInt(it)
}

updateReadStatusOfAllMessages(newXChatLastCommonRead)

processCallStartedMessages(chatMessageList)
Expand All @@ -836,7 +828,7 @@ class ChatActivity :
chatViewModel.refreshChatParams(
setupFieldsForPullChatMessages(
true,
globalLastKnownFutureMessageId,
globalLastKnownPastMessageId,
true
)
)
Expand All @@ -846,7 +838,7 @@ class ChatActivity :
chatViewModel.refreshChatParams(
setupFieldsForPullChatMessages(
true,
globalLastKnownFutureMessageId,
globalLastKnownPastMessageId,
true
)
)
Expand Down

0 comments on commit 1c8d25b

Please sign in to comment.