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

Commit

Permalink
Merge pull request #2352 from RocketChat/chore/sdk-changes
Browse files Browse the repository at this point in the history
[RELEASE] 3.4.2
  • Loading branch information
philipbrito committed Jun 3, 2019
2 parents 62d12ce + e2ae865 commit a3e993f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
applicationId "chat.rocket.android"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 2069
versionName "3.4.1"
versionCode 2070
versionName "3.4.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/chat/rocket/android/db/DatabaseManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import chat.rocket.core.internal.model.Subscription
import chat.rocket.core.internal.realtime.socket.model.StreamMessage
import chat.rocket.core.internal.realtime.socket.model.Type
import chat.rocket.core.model.ChatRoom
import chat.rocket.core.model.LastMessage
import chat.rocket.core.model.Message
import chat.rocket.core.model.Myself
import chat.rocket.core.model.Room
Expand Down Expand Up @@ -400,8 +401,8 @@ class DatabaseManager(val context: Application, val serverUrl: String, val token
}
}

private fun mapLastMessageText(message: Message?): String? = message?.let { lastMessage ->
if (lastMessage.message.isEmpty() && lastMessage.attachments?.isNotEmpty() == true) {
private fun mapLastMessageText(message: LastMessage?): String? = message?.let { lastMessage ->
if (lastMessage.message?.isEmpty() == true && lastMessage.attachments?.isNotEmpty() == true) {
context.getString(R.string.msg_sent_attachment)
} else {
lastMessage.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chat.rocket.android.server.infrastructure

import androidx.lifecycle.MutableLiveData
import chat.rocket.android.db.DatabaseManager
import chat.rocket.common.model.BaseMessage
import chat.rocket.common.model.BaseRoom
import chat.rocket.common.model.User
import chat.rocket.common.model.UserStatus
Expand Down Expand Up @@ -169,7 +170,8 @@ class ConnectionManager(
roomsActor.send(room)
if (room.type != Type.Removed) {
room.data.lastMessage?.let {
messagesActor.send(it)
// FIXME Do we really need to send it to messagesActor?
// messagesActor.send(it as Message)
}
}
}
Expand Down

0 comments on commit a3e993f

Please sign in to comment.