Introduce an entirely new system for handling message preview copy

This reverts earlier changes made to textForEvent as they are no longer needed.

This also implements an entire tree of textForEvent-like behaviour as the previews need to be different, which is easiest done with its own stack.
This commit is contained in:
Travis Ralston 2020-06-25 16:26:07 -06:00
parent 752b2acc56
commit acf56559e1
19 changed files with 799 additions and 76 deletions

View file

@ -271,7 +271,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
let messagePreview = null;
if (this.props.showMessagePreview && !this.props.isMinimized) {
// The preview store heavily caches this info, so should be safe to hammer.
const text = MessagePreviewStore.instance.getPreviewForRoom(this.props.room);
const text = MessagePreviewStore.instance.getPreviewForRoom(this.props.room, this.props.tag);
// Only show the preview if there is one to show.
if (text) {