diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js index 678d44af4..a71e3ac46 100644 --- a/src/components/chat_message/chat_message.js +++ b/src/components/chat_message/chat_message.js @@ -1,21 +1,20 @@ import { mapState as mapPiniaState } from 'pinia' -import { defineAsyncComponent } from 'vue' import { mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' +import MentionLink from 'src/components/mention_link/mention_link.vue' import ChatMessageDate from 'src/components/chat_message_date/chat_message_date.vue' -import EmojiReactions from 'src/components/emoji_reactions/emoji_reactions.vue' import Gallery from 'src/components/gallery/gallery.vue' import LinkPreview from 'src/components/link-preview/link-preview.vue' -import MentionLink from 'src/components/mention_link/mention_link.vue' import Popover from 'src/components/popover/popover.vue' import StatusActionButtons from 'src/components/status_action_buttons/status_action_buttons.vue' import StatusBody from 'src/components/status_body/status_body.vue' import StatusContent from 'src/components/status_content/status_content.vue' import StatusPopover from 'src/components/status_popover/status_popover.vue' -import Timeago from 'src/components/timeago/timeago.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import UserPopover from 'src/components/user_popover/user_popover.vue' +import Timeago from 'src/components/timeago/timeago.vue' +import EmojiReactions from 'src/components/emoji_reactions/emoji_reactions.vue' import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface' @@ -25,10 +24,10 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch, faEllipsisH, + faTimes, faReply, faRetweet, faStar, - faTimes, } from '@fortawesome/free-solid-svg-icons' library.add(faTimes, faEllipsisH, faCircleNotch, faReply, faStar, faRetweet) @@ -60,7 +59,6 @@ const ChatMessage = { UserPopover, StatusPopover, MentionLink, - Quote: defineAsyncComponent(() => import('src/components/quote/quote.vue')), Timeago, }, computed: { @@ -77,24 +75,25 @@ const ChatMessage = { return this.author.id === this.currentUser.id }, message() { - if (!this.isMessage) return null - return this.chatItem.data.retweeted_status ?? this.chatItem.data + return this.isMessage ? this.chatItem.data : null }, isMessage() { return this.chatItem.type === 'message' }, isCustomReply() { if (!this.previousItem) return false - if (!this.message.in_reply_to_status_id) return false - return this.previousItem.data.id !== this.message.in_reply_to_status_id + if (!this.chatItem.data.in_reply_to_status_id) return false + return ( + this.previousItem.data.id !== this.chatItem.data.in_reply_to_status_id + ) }, isBrokenReply() { if (!this.previousItem) return false - return !this.message.in_reply_to_status_id + return !this.chatItem.data.in_reply_to_status_id }, customReplyTo() { return this.$store.state.statuses.allStatusesObject[ - this.message.in_reply_to_status_id + this.chatItem.data.in_reply_to_status_id ] }, replyToName() { @@ -116,22 +115,13 @@ const ChatMessage = { return user ? user.statusnet_profile_url : 'NOT_FOUND' } }, - quoteId() { - return this.message.quote_id - }, - quoteUrl() { - return this.message.quote_url - }, - quoteVisible() { - return this.message.quote_visible - }, messageForStatusContent() { return { - ...this.message, summary: '', emojis: this.message.emojis, raw_html: this.message.content || this.message.raw_html || '', text: this.message.content || '', + attachments: this.message.attachments, } }, hasAttachment() { @@ -200,8 +190,8 @@ const ChatMessage = { const confirmed = window.confirm(this.$t('chats.delete_confirm')) if (confirmed) { await this.$emit('delete', { - messageId: this.message.id, - chatId: this.message.chat_id, + messageId: this.chatItem.data.id, + chatId: this.chatItem.data.chat_id, }) } this.hovered = false diff --git a/src/components/chat_message/chat_message.scss b/src/components/chat_message/chat_message.scss index becf1c0b0..44dd01c30 100644 --- a/src/components/chat_message/chat_message.scss +++ b/src/components/chat_message/chat_message.scss @@ -15,10 +15,6 @@ min-width: 30em; } - .quoted-post { - margin-bottom: 1.5em; - } - .chat-message-toolbar { transition: opacity 0.1s; opacity: 0; diff --git a/src/components/chat_message/chat_message.vue b/src/components/chat_message/chat_message.vue index 1906444fe..a12218008 100644 --- a/src/components/chat_message/chat_message.vue +++ b/src/components/chat_message/chat_message.vue @@ -146,13 +146,6 @@ >