mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 23:04:17 +01:00
Null handling, in case conversation null in GetRoomSuccessState
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
b35bfc1ee7
commit
cf49343132
@ -443,8 +443,10 @@ class ConversationInfoActivity :
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conversation!!.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
conversation?.let {
|
||||||
viewModel.getProfileData(conversationUser, conversation!!.name)
|
if (it.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
||||||
|
viewModel.getProfileData(conversationUser, it.name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,16 +461,19 @@ class ConversationInfoActivity :
|
|||||||
viewModel.getProfileViewState.observe(this) { state ->
|
viewModel.getProfileViewState.observe(this) { state ->
|
||||||
when (state) {
|
when (state) {
|
||||||
is ConversationInfoViewModel.GetProfileSuccessState -> {
|
is ConversationInfoViewModel.GetProfileSuccessState -> {
|
||||||
|
// Pronouns
|
||||||
val profile = state.profile
|
val profile = state.profile
|
||||||
val pronouns = profile.pronouns ?: ""
|
val pronouns = profile.pronouns ?: ""
|
||||||
binding.pronouns.text = pronouns
|
binding.pronouns.text = pronouns
|
||||||
|
|
||||||
|
// Role @ Organization
|
||||||
val concat1 = if (profile.role != null && profile.company != null) " @ " else ""
|
val concat1 = if (profile.role != null && profile.company != null) " @ " else ""
|
||||||
val role = profile.role ?: ""
|
val role = profile.role ?: ""
|
||||||
val company = profile.company ?: ""
|
val company = profile.company ?: ""
|
||||||
val professionCompanyText = "$role$concat1$company"
|
val professionCompanyText = "$role$concat1$company"
|
||||||
binding.professionCompany.text = professionCompanyText
|
binding.professionCompany.text = professionCompanyText
|
||||||
|
|
||||||
|
// Local Time: xX:xX · Address
|
||||||
val profileZoneOffset = ZoneOffset.ofTotalSeconds(0)
|
val profileZoneOffset = ZoneOffset.ofTotalSeconds(0)
|
||||||
val secondsToAdd = profile.timezoneOffset?.toLong() ?: 0
|
val secondsToAdd = profile.timezoneOffset?.toLong() ?: 0
|
||||||
val localTime = ZonedDateTime.ofInstant(Instant.now().plusSeconds(secondsToAdd), profileZoneOffset)
|
val localTime = ZonedDateTime.ofInstant(Instant.now().plusSeconds(secondsToAdd), profileZoneOffset)
|
||||||
|
Loading…
Reference in New Issue
Block a user