Skip to content

Commit 3339fa2

Browse files
committed
Merge pull request element-hq#1232 from vector-im/matthew/permalink
permalink button
2 parents 19cb06d + d4a36f5 commit 3339fa2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/components/views/rooms/MessageContextMenu.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,17 @@ module.exports = React.createClass({
6262
if (this.props.onFinished) this.props.onFinished();
6363
},
6464

65+
onPermalinkClick: function() {
66+
if (this.props.onFinished) this.props.onFinished();
67+
},
68+
6569
render: function() {
6670
var eventStatus = this.props.mxEvent.status;
6771
var resendButton;
6872
var viewSourceButton;
6973
var redactButton;
7074
var cancelButton;
75+
var permalinkButton;
7176

7277
if (eventStatus === 'not_sent') {
7378
resendButton = (
@@ -99,12 +104,22 @@ module.exports = React.createClass({
99104
</div>
100105
);
101106

107+
// XXX: this should be https://matrix.to.
108+
// 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)
109+
permalinkButton = (
110+
<div className="mx_ContextualMenu_field">
111+
<a href={ "#/room/" + this.props.mxEvent.getRoomId() +"/"+ this.props.mxEvent.getId() }
112+
onClick={ this.onPermalinkClick }>Permalink</a>
113+
</div>
114+
);
115+
102116
return (
103117
<div>
104118
{resendButton}
105119
{redactButton}
106120
{cancelButton}
107121
{viewSourceButton}
122+
{permalinkButton}
108123
</div>
109124
);
110125
}

0 commit comments

Comments
 (0)