Implement is_falling_back in accordance to MSC3440 (#8055)
This commit is contained in:
parent
cc9651089e
commit
2acc8fd18b
6 changed files with 23 additions and 23 deletions
|
@ -289,6 +289,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
|||
return {
|
||||
"rel_type": THREAD_RELATION_TYPE.name,
|
||||
"event_id": this.state.thread?.id,
|
||||
"is_falling_back": true,
|
||||
"m.in_reply_to": {
|
||||
"event_id": this.state.lastThreadReply?.getId() ?? this.state.thread?.id,
|
||||
},
|
||||
|
|
|
@ -35,7 +35,7 @@ import ReplyTile from "../rooms/ReplyTile";
|
|||
import Pill from './Pill';
|
||||
import { ButtonEvent } from './AccessibleButton';
|
||||
import { getParentEventId, shouldDisplayReply } from '../../../utils/Reply';
|
||||
import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext";
|
||||
import RoomContext from "../../../contexts/RoomContext";
|
||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||
|
||||
/**
|
||||
|
@ -205,8 +205,6 @@ export default class ReplyChain extends React.Component<IProps, IState> {
|
|||
|
||||
render() {
|
||||
let header = null;
|
||||
|
||||
const inThread = this.context.timelineRenderingType === TimelineRenderingType.Thread;
|
||||
if (this.state.err) {
|
||||
header = <blockquote className="mx_ReplyChain mx_ReplyChain_error">
|
||||
{
|
||||
|
@ -214,7 +212,7 @@ export default class ReplyChain extends React.Component<IProps, IState> {
|
|||
'it either does not exist or you do not have permission to view it.')
|
||||
}
|
||||
</blockquote>;
|
||||
} else if (this.state.loadedEv && shouldDisplayReply(this.state.events[0], inThread)) {
|
||||
} else if (this.state.loadedEv && shouldDisplayReply(this.state.events[0])) {
|
||||
const ev = this.state.loadedEv;
|
||||
const room = this.matrixClient.getRoom(ev.getRoomId());
|
||||
header = <blockquote className={`mx_ReplyChain ${this.getReplyChainColorClass(ev)}`}>
|
||||
|
|
|
@ -1329,8 +1329,7 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
|
|||
msgOption = readAvatars;
|
||||
}
|
||||
|
||||
const inThread = this.context.timelineRenderingType === TimelineRenderingType.Thread;
|
||||
const replyChain = haveTileForEvent(this.props.mxEvent) && shouldDisplayReply(this.props.mxEvent, inThread)
|
||||
const replyChain = haveTileForEvent(this.props.mxEvent) && shouldDisplayReply(this.props.mxEvent)
|
||||
? <ReplyChain
|
||||
parentEv={this.props.mxEvent}
|
||||
onHeightChanged={this.props.onHeightChanged}
|
||||
|
|
|
@ -63,7 +63,6 @@ import { getNestedReplyText, makeReplyMixIn } from '../../../utils/Reply';
|
|||
interface IAddReplyOpts {
|
||||
permalinkCreator?: RoomPermalinkCreator;
|
||||
includeLegacyFallback?: boolean;
|
||||
inThread?: boolean;
|
||||
}
|
||||
|
||||
function addReplyToMessageContent(
|
||||
|
@ -73,7 +72,7 @@ function addReplyToMessageContent(
|
|||
includeLegacyFallback: true,
|
||||
},
|
||||
): void {
|
||||
const replyContent = makeReplyMixIn(replyToEvent, opts.inThread);
|
||||
const replyContent = makeReplyMixIn(replyToEvent);
|
||||
Object.assign(content, replyContent);
|
||||
|
||||
if (opts.includeLegacyFallback) {
|
||||
|
@ -133,7 +132,6 @@ export function createMessageContent(
|
|||
addReplyToMessageContent(content, replyToEvent, {
|
||||
permalinkCreator,
|
||||
includeLegacyFallback: includeReplyLegacyFallback,
|
||||
inThread: relation?.rel_type === THREAD_RELATION_TYPE.name,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -399,7 +397,6 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
|
|||
addReplyToMessageContent(content, replyToEvent, {
|
||||
permalinkCreator: this.props.permalinkCreator,
|
||||
includeLegacyFallback: true,
|
||||
inThread: this.props.relation?.rel_type === THREAD_RELATION_TYPE.name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue