2024-07-30 16:36:53 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { html } from 'lit'
|
|
|
|
import { api } from '@converse/headless'
|
|
|
|
import { getAuthorStyle } from '../../../../src/utils/color.js'
|
|
|
|
import { __ } from 'i18n'
|
|
|
|
|
2024-07-31 19:55:20 +00:00
|
|
|
export function tplMucNoteOccupant (el, occupant, note) {
|
2024-07-30 16:36:53 +00:00
|
|
|
const authorStyle = getAuthorStyle(occupant)
|
|
|
|
const jid = occupant.get('jid')
|
|
|
|
const occupantId = occupant.get('occupant_id')
|
|
|
|
|
|
|
|
return html`
|
|
|
|
<a @click=${(ev) => {
|
|
|
|
api.modal.show('converse-muc-occupant-modal', { model: occupant }, ev)
|
|
|
|
}}>
|
|
|
|
<converse-avatar
|
|
|
|
.model=${occupant}
|
|
|
|
class="avatar chat-msg__avatar"
|
|
|
|
name="${occupant.getDisplayName()}"
|
|
|
|
nonce=${occupant.vcard?.get('vcard_updated')}
|
|
|
|
height="30" width="30"></converse-avatar>
|
|
|
|
|
|
|
|
<span style=${authorStyle}>${occupant.getDisplayName()}</span>
|
|
|
|
</a>
|
|
|
|
${
|
|
|
|
el.full_display
|
2024-07-31 13:53:19 +00:00
|
|
|
? html`<ul aria-hidden="true">
|
2024-07-31 19:55:20 +00:00
|
|
|
${
|
|
|
|
// user changed nick: display the original nick
|
|
|
|
note && note.get('about_nick') && note.get('about_nick') !== occupant.get('nick')
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
? html`<li title=${__(LOC_moderator_note_original_nick)}>${note.get('about_nick')}</li>`
|
|
|
|
: ''
|
|
|
|
}
|
2024-07-30 16:36:53 +00:00
|
|
|
${jid ? html`<li title=${__('XMPP Address')}>${jid}</li>` : ''}
|
|
|
|
${occupantId ? html`<li title=${__('Occupant Id')}>${occupantId}</li>` : ''}
|
|
|
|
</ul>`
|
|
|
|
: ''
|
|
|
|
}
|
|
|
|
`
|
|
|
|
}
|