Show story replies in the timeline
This commit is contained in:
parent
55716c5db6
commit
3620309f22
17 changed files with 705 additions and 461 deletions
|
@ -150,6 +150,7 @@ import { findStoryMessage } from '../util/findStoryMessage';
|
|||
import { isConversationAccepted } from '../util/isConversationAccepted';
|
||||
import { getStoryDataFromMessageAttributes } from '../services/storyLoader';
|
||||
import type { ConversationQueueJobData } from '../jobs/conversationJobQueue';
|
||||
import { getMessageById } from '../messages/getMessageById';
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
/* eslint-disable more/no-then */
|
||||
|
@ -305,6 +306,33 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
);
|
||||
}
|
||||
|
||||
async hydrateStoryContext(): Promise<void> {
|
||||
const storyId = this.get('storyId');
|
||||
if (!storyId) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.get('storyReplyContext')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = await getMessageById(storyId);
|
||||
|
||||
if (!message) {
|
||||
return;
|
||||
}
|
||||
|
||||
const attachments = message.get('attachments');
|
||||
|
||||
this.set({
|
||||
storyReplyContext: {
|
||||
attachment: attachments ? attachments[0] : undefined,
|
||||
authorUuid: message.get('sourceUuid'),
|
||||
messageId: message.get('id'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getPropsForMessageDetail(ourConversationId: string): PropsForMessageDetail {
|
||||
const newIdentity = window.i18n('newIdentity');
|
||||
const OUTGOING_KEY_ERROR = 'OutgoingIdentityKeyError';
|
||||
|
@ -2212,6 +2240,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
quote,
|
||||
storyId: storyQuote?.id,
|
||||
};
|
||||
|
||||
const dataMessage = await upgradeMessageSchema(withQuoteReference);
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue