Fix pinned messages not re-linkifying on edit (#9042)
* Fix pinned messages not re-linkifying on edit * Fix tests
This commit is contained in:
parent
2587aa1369
commit
e576347b62
9 changed files with 30 additions and 13 deletions
|
@ -26,10 +26,10 @@ export interface IBodyProps {
|
|||
mxEvent: MatrixEvent;
|
||||
|
||||
/* a list of words to highlight */
|
||||
highlights: string[];
|
||||
highlights?: string[];
|
||||
|
||||
/* link URL for the highlights */
|
||||
highlightLink: string;
|
||||
highlightLink?: string;
|
||||
|
||||
/* callback called when dynamic content in events are loaded */
|
||||
onHeightChanged: () => void;
|
||||
|
|
|
@ -67,7 +67,7 @@ export default class MessageEvent extends React.Component<IProps> implements IMe
|
|||
public context!: React.ContextType<typeof MatrixClientContext>;
|
||||
|
||||
public constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
|
||||
super(props);
|
||||
super(props, context);
|
||||
|
||||
if (MediaEventHelper.isEligible(this.props.mxEvent)) {
|
||||
this.mediaHelper = new MediaEventHelper(this.props.mxEvent);
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { createRef, SyntheticEvent, MouseEvent } from 'react';
|
||||
import React, { createRef, SyntheticEvent, MouseEvent, ReactNode } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import highlight from 'highlight.js';
|
||||
import { MsgType } from "matrix-js-sdk/src/@types/event";
|
||||
|
@ -565,7 +565,7 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
|
|||
|
||||
// only strip reply if this is the original replying event, edits thereafter do not have the fallback
|
||||
const stripReply = !mxEvent.replacingEvent() && !!getParentEventId(mxEvent);
|
||||
let body;
|
||||
let body: ReactNode;
|
||||
if (SettingsStore.isEnabled("feature_extensible_events")) {
|
||||
const extev = this.props.mxEvent.unstableExtensibleEvent as MessageEvent;
|
||||
if (extev?.isEquivalentTo(M_MESSAGE)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue