2020-05-07 16:10:53 +03:00
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
v-if="isMessage"
|
|
|
|
|
class="chat-message-wrapper"
|
|
|
|
|
:class="{ 'hovered-message-chain': hoveredMessageChain }"
|
|
|
|
|
@mouseover="onHover(true)"
|
|
|
|
|
@mouseleave="onHover(false)"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="chat-message"
|
2026-07-08 17:47:50 +03:00
|
|
|
:class="[{ '-outgoing': isCurrentUser, '-incoming': !isCurrentUser, '-pending': message.pending }]"
|
2020-05-07 16:10:53 +03:00
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
v-if="!isCurrentUser"
|
|
|
|
|
class="avatar-wrapper"
|
|
|
|
|
>
|
2022-07-20 12:54:51 +03:00
|
|
|
<UserPopover
|
2026-07-07 20:44:13 +03:00
|
|
|
v-if="chatItem.isHead"
|
2022-07-31 12:35:48 +03:00
|
|
|
:user-id="author.id"
|
2020-05-07 16:10:53 +03:00
|
|
|
>
|
|
|
|
|
<UserAvatar
|
|
|
|
|
:compact="true"
|
|
|
|
|
:user="author"
|
|
|
|
|
/>
|
2022-07-20 12:54:51 +03:00
|
|
|
</UserPopover>
|
2020-05-07 16:10:53 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="chat-message-inner">
|
2026-07-10 17:09:17 +03:00
|
|
|
<small
|
|
|
|
|
v-if="isStatus && isCustomReply"
|
|
|
|
|
class="reply-to-header faint"
|
|
|
|
|
>
|
|
|
|
|
<strong class="reply-label">
|
|
|
|
|
<FAIcon
|
|
|
|
|
class="fa-scale-110 fa-old-padding"
|
|
|
|
|
icon="reply"
|
|
|
|
|
flip="horizontal"
|
|
|
|
|
/>
|
|
|
|
|
{{ $t('status.reply_to') }}
|
|
|
|
|
</strong>
|
|
|
|
|
<StatusBody
|
|
|
|
|
class="reply-body"
|
|
|
|
|
:status="customReplyTo"
|
|
|
|
|
collapse
|
|
|
|
|
single-line
|
|
|
|
|
/>
|
|
|
|
|
</small>
|
2020-05-07 16:10:53 +03:00
|
|
|
<div
|
|
|
|
|
class="status-body"
|
|
|
|
|
:style="{ 'min-width': message.attachment ? '80%' : '' }"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="media status"
|
2026-07-07 20:44:13 +03:00
|
|
|
:class="{ 'without-attachment': !hasAttachment, 'pending': chatItem.data.pending, 'error': chatItem.data.error }"
|
2023-01-09 13:02:16 -05:00
|
|
|
style="position: relative;"
|
2020-05-07 16:10:53 +03:00
|
|
|
@mouseenter="hovered = true"
|
|
|
|
|
@mouseleave="hovered = false"
|
|
|
|
|
>
|
2026-07-10 17:09:17 +03:00
|
|
|
|
|
|
|
|
<StatusActionButtons
|
|
|
|
|
v-if="isStatus"
|
|
|
|
|
class="chat-message-toolbar"
|
|
|
|
|
:class="{ '-visible': hovered || menuOpened }"
|
|
|
|
|
:status="message"
|
|
|
|
|
:pinned="new Set(['reply', 'emoji'])"
|
|
|
|
|
fixed-pinned
|
|
|
|
|
use-default-buttons
|
|
|
|
|
hide-labels
|
|
|
|
|
@toggle-replying="$emit('replyRequested', message)"
|
|
|
|
|
/>
|
2020-05-07 16:10:53 +03:00
|
|
|
<div
|
2026-07-10 17:09:17 +03:00
|
|
|
class="chat-message-toolbar"
|
|
|
|
|
:class="{ '-visible': hovered || menuOpened }"
|
|
|
|
|
v-else
|
2020-05-07 16:10:53 +03:00
|
|
|
>
|
|
|
|
|
<Popover
|
|
|
|
|
trigger="click"
|
2026-07-10 17:09:17 +03:00
|
|
|
:trigger-attrs="{ 'class': 'button-default menu-icon simple-button', title: $t('chats.more') }"
|
2020-05-07 16:10:53 +03:00
|
|
|
placement="top"
|
|
|
|
|
:margin="popoverMarginStyle"
|
|
|
|
|
@show="menuOpened = true"
|
|
|
|
|
@close="menuOpened = false"
|
|
|
|
|
>
|
2022-07-31 12:35:48 +03:00
|
|
|
<template #content>
|
2020-05-07 16:10:53 +03:00
|
|
|
<div class="dropdown-menu">
|
2025-01-13 17:38:44 +02:00
|
|
|
<div class="menu-item dropdown-item -icon">
|
|
|
|
|
<button
|
|
|
|
|
class="main-button"
|
|
|
|
|
@click="deleteMessage"
|
|
|
|
|
>
|
|
|
|
|
<FAIcon icon="times" /> {{ $t("chats.delete") }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2020-05-07 16:10:53 +03:00
|
|
|
</div>
|
2021-04-07 22:42:34 +03:00
|
|
|
</template>
|
2022-07-31 12:35:48 +03:00
|
|
|
<template #trigger>
|
2026-07-10 17:09:17 +03:00
|
|
|
<FAIcon icon="ellipsis-h" />
|
2021-04-07 22:42:34 +03:00
|
|
|
</template>
|
2020-05-07 16:10:53 +03:00
|
|
|
</Popover>
|
|
|
|
|
</div>
|
|
|
|
|
<StatusContent
|
2021-06-07 19:50:26 +03:00
|
|
|
class="message-content"
|
2026-07-08 17:47:50 +03:00
|
|
|
:class="{ faint: message.pending }"
|
2020-05-07 16:10:53 +03:00
|
|
|
:status="messageForStatusContent"
|
|
|
|
|
:full-content="true"
|
|
|
|
|
>
|
2022-07-31 12:35:48 +03:00
|
|
|
<template #footer>
|
2021-04-07 22:42:34 +03:00
|
|
|
<span
|
|
|
|
|
class="created-at"
|
|
|
|
|
>
|
2026-07-09 01:07:59 +03:00
|
|
|
<span
|
|
|
|
|
v-if="message.visibility"
|
|
|
|
|
class="visibility-icon"
|
|
|
|
|
:title="visibilityLocalized"
|
|
|
|
|
>
|
|
|
|
|
<FAIcon
|
|
|
|
|
class="fa-scale-110"
|
|
|
|
|
:icon="visibilityIcon(message.visibility)"
|
2026-07-10 17:09:17 +03:00
|
|
|
fixed-width
|
2026-07-09 01:07:59 +03:00
|
|
|
/>
|
|
|
|
|
</span>
|
2026-07-08 17:47:50 +03:00
|
|
|
<span
|
|
|
|
|
v-if="message.pending"
|
|
|
|
|
class="loading-spinner"
|
|
|
|
|
>
|
|
|
|
|
<FAIcon
|
|
|
|
|
class="fa-old-padding"
|
|
|
|
|
icon="circle-notch"
|
2026-07-10 17:09:17 +03:00
|
|
|
spin
|
2026-07-08 17:47:50 +03:00
|
|
|
/>
|
|
|
|
|
</span>
|
2021-04-07 22:42:34 +03:00
|
|
|
{{ createdAt }}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
2020-05-07 16:10:53 +03:00
|
|
|
</StatusContent>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-else
|
|
|
|
|
class="chat-message-date-separator"
|
|
|
|
|
>
|
2026-07-07 21:15:15 +03:00
|
|
|
<ChatMessageDate :date="chatItem.date" :show-time="chatItem.isTime" />
|
2020-05-07 16:10:53 +03:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2022-07-31 12:35:48 +03:00
|
|
|
<script src="./chat_message.js"></script>
|
2020-05-07 16:10:53 +03:00
|
|
|
|
2025-02-18 22:31:33 +02:00
|
|
|
<style src="./chat_message.scss" lang="scss" />
|