import 'shared/chat/unfurl.js'; import { __ } from 'i18n'; import { html } from "lit"; import { shouldRenderMediaFromURL } from '@converse/headless/utils/url.js'; export default (el, o) => { const i18n_new_messages = __('New messages'); return html` ${ o.is_first_unread ? html`

${ i18n_new_messages }
` : '' }
${ o.should_show_avatar ? html` ` : '' }
${ !o.is_me_message ? html` ${o.username} ${ o.hats.map(h => html`${h.title}`) } ${ o.is_encrypted ? html`` : '' } ` : '' }
${ (o.is_me_message) ? html`   ${ o.is_me_message ? '**' : ''}${o.username} ` : '' } ${ o.is_retracted ? el.renderRetraction() : el.renderMessageText() }
${ el.model.get('ogp_metadata')?.map(m => { if (el.model.get('hide_url_previews') === true) { return ''; } if (!shouldRenderMediaFromURL(m['og:image'], 'image')) { return ''; } return html`` }) }
`; }