Fixed conversation avatar not updated when subject changes

This commit is contained in:
Sylvain Berfini 2025-10-22 10:02:28 +02:00
parent e267f46fd7
commit ce2b794936
2 changed files with 6 additions and 2 deletions

View file

@ -158,6 +158,7 @@ class ConversationModel
override fun onSubjectChanged(chatRoom: ChatRoom, eventLog: EventLog) {
Log.i("$TAG Conversation subject changed [${chatRoom.subject}]")
subject.postValue(chatRoom.subject)
computeParticipants()
}
@WorkerThread
@ -431,7 +432,7 @@ class ConversationModel
}
if (isGroup) {
if (avatarModel.value == null) {
if (avatarModel.value == null || avatarModel.value?.contactName != chatRoom.subject) {
val fakeFriend = coreContext.core.createFriend()
fakeFriend.name = chatRoom.subject
val model = ContactAvatarModel(fakeFriend)

View file

@ -159,6 +159,7 @@ class ConversationInfoViewModel
showGreenToast(R.string.conversation_subject_changed_toast, R.drawable.check)
subject.postValue(chatRoom.subject)
computeParticipantsList()
infoChangedEvent.postValue(Event(true))
}
@ -562,7 +563,9 @@ class ConversationInfoViewModel
} else {
participantsList.first().avatarModel
}
avatarModel.postValue(avatar)
if (!avatar.compare(avatarModel.value)) {
avatarModel.postValue(avatar)
}
participants.postValue(participantsList)
participantsLabel.postValue(