forked from GitHub-Mirror/riotX-android
Hot fix : makes room topic optional as it may be null.
This commit is contained in:
parent
c7c3a57c93
commit
32b29c47e7
@ -1,6 +1,5 @@
|
||||
package im.vector.riotredesign.features.home.room.detail.timeline
|
||||
|
||||
import android.text.TextUtils
|
||||
import im.vector.matrix.android.api.session.events.model.TimelineEvent
|
||||
import im.vector.matrix.android.api.session.events.model.toModel
|
||||
import im.vector.matrix.android.api.session.room.model.RoomTopicContent
|
||||
@ -16,10 +15,10 @@ class RoomTopicItemFactory(private val stringProvider: StringProvider) {
|
||||
if (content == null || roomMember == null) {
|
||||
return null
|
||||
}
|
||||
val text = if (!TextUtils.isEmpty(content.topic)) {
|
||||
stringProvider.getString(R.string.notice_room_topic_changed, roomMember.displayName, content.topic)
|
||||
} else {
|
||||
val text = if (content.topic.isNullOrEmpty()) {
|
||||
stringProvider.getString(R.string.notice_room_topic_removed, roomMember.displayName)
|
||||
} else {
|
||||
stringProvider.getString(R.string.notice_room_topic_changed, roomMember.displayName, content.topic)
|
||||
}
|
||||
return NoticeItem(text, roomMember.avatarUrl, roomMember.displayName)
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RoomTopicContent(
|
||||
@Json(name = "topic") val topic: String
|
||||
@Json(name = "topic") val topic: String? = null
|
||||
)
|
Loading…
Reference in New Issue
Block a user