ShareDialog share Message, link to timestamp and permalink in ctx menu

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-06-14 13:35:35 +01:00
parent aa7d62b740
commit 7d7a6f3d9c
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E
3 changed files with 28 additions and 5 deletions

View file

@ -16,7 +16,7 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import {Room, User, Group, RoomMember} from 'matrix-js-sdk';
import {Room, User, Group, RoomMember, MatrixEvent} from 'matrix-js-sdk';
import sdk from '../../../index';
import { _t } from '../../../languageHandler';
import QRCode from 'qrcode-react';
@ -59,7 +59,7 @@ export default class ShareDialog extends React.Component {
PropTypes.instanceOf(User),
PropTypes.instanceOf(Group),
PropTypes.instanceOf(RoomMember),
// PropTypes.instanceOf(MatrixEvent),
PropTypes.instanceOf(MatrixEvent),
]).isRequired,
};
@ -155,6 +155,9 @@ export default class ShareDialog extends React.Component {
} else if (this.props.target instanceof Group) {
title = _t('Share Community');
matrixToUrl = makeGroupPermalink(this.props.target.groupId);
} else if (this.props.target instanceof MatrixEvent) {
title = _t('Share Room Message');
matrixToUrl = makeEventPermalink(this.props.target.roomId, this.props.target.eventId);
}
const encodedUrl = encodeURIComponent(matrixToUrl);