Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 95ab3dc

Browse files
authored
Merge pull request #1835 from RocketChat/release/3.1.1-hotfix
[RELEASE] 3.1.1 hotfix
2 parents b6cf0ae + c690081 commit 95ab3dc

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
applicationId "chat.rocket.android"
1717
minSdkVersion versions.minSdk
1818
targetSdkVersion versions.targetSdk
19-
versionCode 2049
20-
versionName "3.1.0"
19+
versionCode 2050
20+
versionName "3.1.1"
2121
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2222
multiDexEnabled true
2323

app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,24 +1169,26 @@ class ChatRoomPresenter @Inject constructor(
11691169
}
11701170

11711171
private fun processTypingStatus(typingStatus: Pair<String, Boolean>) {
1172-
if (typingStatus.first != currentLoggedUsername) {
1173-
if (!typingStatusList.any { username -> username == typingStatus.first }) {
1174-
if (typingStatus.second) {
1175-
typingStatusList.add(typingStatus.first)
1176-
}
1177-
} else {
1178-
typingStatusList.find { username -> username == typingStatus.first }?.let {
1179-
typingStatusList.remove(it)
1172+
synchronized(typingStatusList) {
1173+
if (typingStatus.first != currentLoggedUsername) {
1174+
if (!typingStatusList.any { username -> username == typingStatus.first }) {
11801175
if (typingStatus.second) {
11811176
typingStatusList.add(typingStatus.first)
11821177
}
1178+
} else {
1179+
typingStatusList.find { username -> username == typingStatus.first }?.let {
1180+
typingStatusList.remove(it)
1181+
if (typingStatus.second) {
1182+
typingStatusList.add(typingStatus.first)
1183+
}
1184+
}
11831185
}
1184-
}
11851186

1186-
if (typingStatusList.isNotEmpty()) {
1187-
view.showTypingStatus(typingStatusList.toList())
1188-
} else {
1189-
view.hideTypingStatusView()
1187+
if (typingStatusList.isNotEmpty()) {
1188+
view.showTypingStatus(typingStatusList.toList())
1189+
} else {
1190+
view.hideTypingStatusView()
1191+
}
11901192
}
11911193
}
11921194
}

app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
545545

546546
override fun dispatchUpdateMessage(index: Int, message: List<BaseUiModel<*>>) {
547547
ui {
548+
// TODO - investigate WHY we get a empty list here
549+
if (message.isEmpty()) return@ui
550+
548551
if (adapter.updateItem(message.last())) {
549552
if (message.size > 1) {
550553
adapter.prependData(listOf(message.first()))
@@ -591,7 +594,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
591594
}
592595
}
593596

594-
override fun showGenericErrorMessage() = showMessage(getString(R.string.msg_generic_error))
597+
override fun showGenericErrorMessage(){
598+
ui {
599+
showMessage(getString(R.string.msg_generic_error))
600+
}
601+
}
595602

596603
override fun populatePeopleSuggestions(members: List<PeopleSuggestionUiModel>) {
597604
ui {

0 commit comments

Comments
 (0)