Skip to content

Commit 879c626

Browse files
committed
fix incorrect sender name when there are multiple participants involved
1 parent 16fbfa7 commit 879c626

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

frontend/src/features/conversation/message/ContactMessageBubble.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ const settingsStore = useAppSettingsStore()
102102
const showQuotedText = ref(false)
103103
const { t } = useI18n()
104104
105+
const participant = computed(() => {
106+
return convStore.conversation?.participants?.[props.message.sender_id] ?? {}
107+
})
108+
105109
const getAvatar = computed(() => {
106-
return convStore.current?.contact?.avatar_url || ''
110+
return participant.value?.avatar_url || ''
107111
})
108112
const sanitizedMessageContent = computed(() => {
109113
let content = props.message.content || ''
@@ -132,13 +136,14 @@ const nonInlineAttachments = computed(() =>
132136
)
133137
134138
const getFullName = computed(() => {
135-
const contact = convStore.current?.contact || {}
136-
return `${contact.first_name || ''} ${contact.last_name || ''}`.trim()
139+
const firstName = participant.value?.first_name ?? 'User'
140+
const lastName = participant.value?.last_name ?? ''
141+
return `${firstName} ${lastName}`
137142
})
138143
139144
const avatarFallback = computed(() => {
140-
const contact = convStore.current?.contact || {}
141-
return (contact.first_name || '').toUpperCase().substring(0, 2)
145+
const firstName = participant.value?.first_name ?? 'U'
146+
return firstName.toUpperCase().substring(0, 2)
142147
})
143148
144149
const showEnvelope = computed(() => {

0 commit comments

Comments
 (0)