create permalink creator in roomview and pass it on to the event tiles

This commit is contained in:
Bruno Windels 2019-02-21 15:44:20 +01:00
parent 8d929add18
commit 29be28919d
6 changed files with 23 additions and 5 deletions

View file

@ -32,7 +32,6 @@ import withMatrixClient from '../../../wrappers/withMatrixClient';
const ContextualMenu = require('../../structures/ContextualMenu');
import dis from '../../../dispatcher';
import {makeEventPermalink} from "../../../matrix-to";
import SettingsStore from "../../../settings/SettingsStore";
import {EventStatus} from 'matrix-js-sdk';
@ -544,7 +543,10 @@ module.exports = withMatrixClient(React.createClass({
mx_EventTile_redacted: isRedacted,
});
const permalink = makeEventPermalink(this.props.mxEvent.getRoomId(), this.props.mxEvent.getId());
let permalink = "#";
if (this.props.permaLinkCreator) {
permalink = this.props.permaLinkCreator.forEvent(this.props.mxEvent.getId());
}
const readAvatars = this.getReadAvatars();

View file

@ -56,6 +56,7 @@ module.exports = React.createClass({
}
if (EventTile.haveTileForEvent(ev)) {
ret.push(<EventTile key={eventId+"+"+j} mxEvent={ev} contextual={contextual} highlights={highlights}
permaLinkCreator={this.props.permaLinkCreator}
highlightLink={this.props.resultLink}
onWidgetLoad={this.props.onWidgetLoad} />);
}