Skip to content

Commit

Permalink
Merge pull request #1232 from vector-im/matthew/permalink
Browse files Browse the repository at this point in the history
permalink button
  • Loading branch information
ara4n committed Mar 21, 2016
2 parents 19cb06d + d4a36f5 commit 3339fa2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/views/rooms/MessageContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ module.exports = React.createClass({
if (this.props.onFinished) this.props.onFinished();
},

onPermalinkClick: function() {
if (this.props.onFinished) this.props.onFinished();
},

render: function() {
var eventStatus = this.props.mxEvent.status;
var resendButton;
var viewSourceButton;
var redactButton;
var cancelButton;
var permalinkButton;

if (eventStatus === 'not_sent') {
resendButton = (
Expand Down Expand Up @@ -99,12 +104,22 @@ module.exports = React.createClass({
</div>
);

// XXX: this should be https://matrix.to.
// XXX: if we use room ID, we should also include a server where the event can be found (other than in the domain of the event ID)
permalinkButton = (
<div className="mx_ContextualMenu_field">
<a href={ "#/room/" + this.props.mxEvent.getRoomId() +"/"+ this.props.mxEvent.getId() }
onClick={ this.onPermalinkClick }>Permalink</a>
</div>
);

return (
<div>
{resendButton}
{redactButton}
{cancelButton}
{viewSourceButton}
{permalinkButton}
</div>
);
}
Expand Down

0 comments on commit 3339fa2

Please sign in to comment.