Added ourselves as participant of a conversation

This commit is contained in:
Sylvain Berfini 2024-01-18 14:11:41 +01:00
parent e4d073471c
commit 8aa17ed097
2 changed files with 20 additions and 4 deletions

View file

@ -261,10 +261,6 @@ class ConferenceModel {
val conferenceParticipants = conference.participantList
Log.i("$TAG [${conferenceParticipants.size}] participant in conference")
val meParticipant = conference.me
val meParticipantModel = ConferenceParticipantModel(meParticipant)
participantsList.add(meParticipantModel)
for (participant in conferenceParticipants) {
val devices = participant.devices
val role = participant.role
@ -288,6 +284,10 @@ class ConferenceModel {
"$TAG [${devicesList.size}] participant devices for [${participantsList.size}] participants will be displayed (not counting ourselves)"
)
val meParticipant = conference.me
val meParticipantModel = ConferenceParticipantModel(meParticipant)
participantsList.add(meParticipantModel)
val ourDevices = conference.me.devices
Log.i("$TAG We have [${ourDevices.size}] devices")
for (device in ourDevices) {

View file

@ -535,6 +535,22 @@ class ConversationInfoViewModel @UiThread constructor() : ViewModel() {
friends.add(model.avatarModel.friend)
participantsList.add(model)
}
// Add ourselves at the end of the list
val meParticipant = chatRoom.me
if (meParticipant != null) {
val model = ParticipantModel(
meParticipant.address,
selfAdmin,
isParticipantAdmin = selfAdmin,
showMenu = false,
onMenuClicked = { view, model ->
// openMenu
showParticipantAdminPopupMenuEvent.postValue(Event(Pair(view, model)))
}
)
participantsList.add(model)
}
}
val avatar = if (groupChatRoom) {