Change Share Message to Share Permalink if !m.room.message||redacted
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
150c941340
commit
f2624beca4
2 changed files with 14 additions and 9 deletions
|
@ -211,7 +211,8 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const eventStatus = this.props.mxEvent.status;
|
const mxEvent = this.props.mxEvent;
|
||||||
|
const eventStatus = mxEvent.status;
|
||||||
let resendButton;
|
let resendButton;
|
||||||
let redactButton;
|
let redactButton;
|
||||||
let cancelButton;
|
let cancelButton;
|
||||||
|
@ -251,8 +252,8 @@ module.exports = React.createClass({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSent && this.props.mxEvent.getType() === 'm.room.message') {
|
if (isSent && mxEvent.getType() === 'm.room.message') {
|
||||||
const content = this.props.mxEvent.getContent();
|
const content = mxEvent.getContent();
|
||||||
if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) {
|
if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) {
|
||||||
forwardButton = (
|
forwardButton = (
|
||||||
<div className="mx_MessageContextMenu_field" onClick={this.onForwardClick}>
|
<div className="mx_MessageContextMenu_field" onClick={this.onForwardClick}>
|
||||||
|
@ -282,7 +283,7 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.props.mxEvent.getType() !== this.props.mxEvent.getWireType()) {
|
if (mxEvent.getType() !== mxEvent.getWireType()) {
|
||||||
viewClearSourceButton = (
|
viewClearSourceButton = (
|
||||||
<div className="mx_MessageContextMenu_field" onClick={this.onViewClearSourceClick}>
|
<div className="mx_MessageContextMenu_field" onClick={this.onViewClearSourceClick}>
|
||||||
{ _t('View Decrypted Source') }
|
{ _t('View Decrypted Source') }
|
||||||
|
@ -303,8 +304,11 @@ module.exports = React.createClass({
|
||||||
// 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)
|
// 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)
|
||||||
const permalinkButton = (
|
const permalinkButton = (
|
||||||
<div className="mx_MessageContextMenu_field">
|
<div className="mx_MessageContextMenu_field">
|
||||||
<a href={makeEventPermalink(this.props.mxEvent.getRoomId(), this.props.mxEvent.getId())}
|
<a href={makeEventPermalink(mxEvent.getRoomId(), mxEvent.getId())}
|
||||||
target="_blank" rel="noopener" onClick={this.onPermalinkClick}>{ _t('Share Message') }</a>
|
target="_blank" rel="noopener" onClick={this.onPermalinkClick}>
|
||||||
|
{ mxEvent.isRedacted() || mxEvent.getType() !== 'm.room.message'
|
||||||
|
? _t('Share Permalink') : _t('Share Message') }
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -318,12 +322,12 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
// Bridges can provide a 'external_url' to link back to the source.
|
// Bridges can provide a 'external_url' to link back to the source.
|
||||||
if (
|
if (
|
||||||
typeof(this.props.mxEvent.event.content.external_url) === "string" &&
|
typeof(mxEvent.event.content.external_url) === "string" &&
|
||||||
isUrlPermitted(this.props.mxEvent.event.content.external_url)
|
isUrlPermitted(mxEvent.event.content.external_url)
|
||||||
) {
|
) {
|
||||||
externalURLButton = (
|
externalURLButton = (
|
||||||
<div className="mx_MessageContextMenu_field">
|
<div className="mx_MessageContextMenu_field">
|
||||||
<a href={this.props.mxEvent.event.content.external_url}
|
<a href={mxEvent.event.content.external_url}
|
||||||
rel="noopener" target="_blank" onClick={this.closeMenu}>{ _t('Source URL') }</a>
|
rel="noopener" target="_blank" onClick={this.closeMenu}>{ _t('Source URL') }</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1202,6 +1202,7 @@
|
||||||
"View Decrypted Source": "View Decrypted Source",
|
"View Decrypted Source": "View Decrypted Source",
|
||||||
"Unhide Preview": "Unhide Preview",
|
"Unhide Preview": "Unhide Preview",
|
||||||
"Share Message": "Share Message",
|
"Share Message": "Share Message",
|
||||||
|
"Share Permalink": "Share Permalink",
|
||||||
"Quote": "Quote",
|
"Quote": "Quote",
|
||||||
"Source URL": "Source URL",
|
"Source URL": "Source URL",
|
||||||
"Collapse Reply Thread": "Collapse Reply Thread",
|
"Collapse Reply Thread": "Collapse Reply Thread",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue