mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-12-18 06:32:08 +03:00
Merge pull request #4440 from nextcloud/bugfix/noid/fixUnreadMarkerCrash
fix crash for unreadMarker
This commit is contained in:
commit
89f3d8a768
1 changed files with 8 additions and 6 deletions
|
@ -2685,12 +2685,14 @@ class ChatActivity :
|
|||
private fun isScrolledToBottom() = layoutManager?.findFirstVisibleItemPosition() == 0
|
||||
|
||||
private fun setUnreadMessageMarker(chatMessageList: List<ChatMessage>) {
|
||||
val unreadChatMessage = ChatMessage()
|
||||
unreadChatMessage.jsonMessageId = UNREAD_MESSAGES_MARKER_ID
|
||||
unreadChatMessage.actorId = "-1"
|
||||
unreadChatMessage.timestamp = chatMessageList[0].timestamp
|
||||
unreadChatMessage.message = context.getString(R.string.nc_new_messages)
|
||||
adapter?.addToStart(unreadChatMessage, false)
|
||||
if (chatMessageList.isNotEmpty()) {
|
||||
val unreadChatMessage = ChatMessage()
|
||||
unreadChatMessage.jsonMessageId = UNREAD_MESSAGES_MARKER_ID
|
||||
unreadChatMessage.actorId = "-1"
|
||||
unreadChatMessage.timestamp = chatMessageList[0].timestamp
|
||||
unreadChatMessage.message = context.getString(R.string.nc_new_messages)
|
||||
adapter?.addToStart(unreadChatMessage, false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun processMessagesNotFromTheFuture(chatMessageList: List<ChatMessage>) {
|
||||
|
|
Loading…
Reference in a new issue