Update m.render_in to is_falling_back (+ unstable field) (#7979)

This commit is contained in:
Michael Telatynski 2022-03-09 16:15:53 +00:00 committed by GitHub
parent 2ab8b46ba3
commit 288e47fd81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 31 deletions

View file

@ -1403,11 +1403,8 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
msgOption = readAvatars;
}
const renderTarget = this.context.timelineRenderingType === TimelineRenderingType.Thread
? RelationType.Thread
: undefined;
const replyChain = haveTileForEvent(this.props.mxEvent) && shouldDisplayReply(this.props.mxEvent, renderTarget)
const inThread = this.context.timelineRenderingType === TimelineRenderingType.Thread;
const replyChain = haveTileForEvent(this.props.mxEvent) && shouldDisplayReply(this.props.mxEvent, inThread)
? <ReplyChain
parentEv={this.props.mxEvent}
onHeightChanged={this.props.onHeightChanged}

View file

@ -57,12 +57,12 @@ import { ComposerType } from "../../../dispatcher/payloads/ComposerInsertPayload
import { getSlashCommand, isSlashCommand, runSlashCommand, shouldSendAnyway } from "../../../editor/commands";
import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
import { PosthogAnalytics } from "../../../PosthogAnalytics";
import { getNestedReplyText, getRenderInMixin, makeReplyMixIn } from '../../../utils/Reply';
import { getNestedReplyText, makeReplyMixIn } from '../../../utils/Reply';
interface IAddReplyOpts {
permalinkCreator?: RoomPermalinkCreator;
includeLegacyFallback?: boolean;
renderIn?: string[];
inThread?: boolean;
}
function addReplyToMessageContent(
@ -72,7 +72,7 @@ function addReplyToMessageContent(
includeLegacyFallback: true,
},
): void {
const replyContent = makeReplyMixIn(replyToEvent, opts.renderIn);
const replyContent = makeReplyMixIn(replyToEvent, opts.inThread);
Object.assign(content, replyContent);
if (opts.includeLegacyFallback) {
@ -131,8 +131,8 @@ export function createMessageContent(
if (replyToEvent) {
addReplyToMessageContent(content, replyToEvent, {
permalinkCreator,
includeLegacyFallback: true,
renderIn: getRenderInMixin(relation),
includeLegacyFallback: includeReplyLegacyFallback,
inThread: relation?.rel_type === RelationType.Thread,
});
}
@ -398,7 +398,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
addReplyToMessageContent(content, replyToEvent, {
permalinkCreator: this.props.permalinkCreator,
includeLegacyFallback: true,
renderIn: getRenderInMixin(this.props.relation),
inThread: this.props.relation?.rel_type === RelationType.Thread,
});
}
} else {