diff --git a/app/build.gradle b/app/build.gradle index b08927161e..090c3dc927 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "chat.rocket.android" minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk - versionCode 2049 - versionName "3.1.0" + versionCode 2050 + versionName "3.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true diff --git a/app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt b/app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt index be1bea6af1..a66560afb2 100644 --- a/app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt +++ b/app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt @@ -1169,24 +1169,26 @@ class ChatRoomPresenter @Inject constructor( } private fun processTypingStatus(typingStatus: Pair) { - if (typingStatus.first != currentLoggedUsername) { - if (!typingStatusList.any { username -> username == typingStatus.first }) { - if (typingStatus.second) { - typingStatusList.add(typingStatus.first) - } - } else { - typingStatusList.find { username -> username == typingStatus.first }?.let { - typingStatusList.remove(it) + synchronized(typingStatusList) { + if (typingStatus.first != currentLoggedUsername) { + if (!typingStatusList.any { username -> username == typingStatus.first }) { if (typingStatus.second) { typingStatusList.add(typingStatus.first) } + } else { + typingStatusList.find { username -> username == typingStatus.first }?.let { + typingStatusList.remove(it) + if (typingStatus.second) { + typingStatusList.add(typingStatus.first) + } + } } - } - if (typingStatusList.isNotEmpty()) { - view.showTypingStatus(typingStatusList.toList()) - } else { - view.hideTypingStatusView() + if (typingStatusList.isNotEmpty()) { + view.showTypingStatus(typingStatusList.toList()) + } else { + view.hideTypingStatusView() + } } } } diff --git a/app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt b/app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt index 6e8b9db154..606e627bb6 100644 --- a/app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt +++ b/app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt @@ -545,6 +545,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR override fun dispatchUpdateMessage(index: Int, message: List>) { ui { + // TODO - investigate WHY we get a empty list here + if (message.isEmpty()) return@ui + if (adapter.updateItem(message.last())) { if (message.size > 1) { adapter.prependData(listOf(message.first())) @@ -591,7 +594,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR } } - override fun showGenericErrorMessage() = showMessage(getString(R.string.msg_generic_error)) + override fun showGenericErrorMessage(){ + ui { + showMessage(getString(R.string.msg_generic_error)) + } + } override fun populatePeopleSuggestions(members: List) { ui {