suppress link on MN in preview, check for invalid content in preview
This commit is contained in:
@@ -88,7 +88,13 @@ class Contact extends React.Component {
|
|||||||
|
|
||||||
const subtitle = this.props.preview ?
|
const subtitle = this.props.preview ?
|
||||||
(typeof this.props.preview == 'string' ? this.props.preview :
|
(typeof this.props.preview == 'string' ? this.props.preview :
|
||||||
React.createElement(React.Fragment, null, Drafty.format(this.props.preview, draftyFormatter, this))) :
|
Drafty.isValid(this.props.preview) ?
|
||||||
|
React.createElement(React.Fragment, null, Drafty.format(this.props.preview, draftyFormatter, this)) :
|
||||||
|
<><i className="material-icons gray">error_outline</i> <i className="gray">
|
||||||
|
<FormattedMessage id="invalid_content"
|
||||||
|
defaultMessage="invalid content" description="Shown when message is unreadable" /></i>
|
||||||
|
</>
|
||||||
|
) :
|
||||||
this.props.comment;
|
this.props.comment;
|
||||||
|
|
||||||
const icon = deliveryMarker(this.props.received);
|
const icon = deliveryMarker(this.props.received);
|
||||||
@@ -146,6 +152,7 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
attr.className = 'highlight preview';
|
attr.className = 'highlight preview';
|
||||||
break;
|
break;
|
||||||
case 'LN':
|
case 'LN':
|
||||||
|
case 'MN':
|
||||||
// Disable links in previews.
|
// Disable links in previews.
|
||||||
el = 'span';
|
el = 'span';
|
||||||
break;
|
break;
|
||||||
|
|||||||
+12
-1
@@ -7954,7 +7954,17 @@ class Contact extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const subtitle = this.props.preview ? typeof this.props.preview == 'string' ? this.props.preview : react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, tinode_sdk__WEBPACK_IMPORTED_MODULE_6__.Drafty.format(this.props.preview, draftyFormatter, this)) : this.props.comment;
|
const subtitle = this.props.preview ? typeof this.props.preview == 'string' ? this.props.preview : tinode_sdk__WEBPACK_IMPORTED_MODULE_6__.Drafty.isValid(this.props.preview) ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, tinode_sdk__WEBPACK_IMPORTED_MODULE_6__.Drafty.format(this.props.preview, draftyFormatter, this)) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||||
|
className: "material-icons gray"
|
||||||
|
}, "error_outline"), " ", react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||||
|
className: "gray"
|
||||||
|
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||||
|
id: "invalid_content",
|
||||||
|
defaultMessage: [{
|
||||||
|
"type": 0,
|
||||||
|
"value": "invalid content"
|
||||||
|
}]
|
||||||
|
}))) : this.props.comment;
|
||||||
const icon = (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_7__.deliveryMarker)(this.props.received);
|
const icon = (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_7__.deliveryMarker)(this.props.received);
|
||||||
const marker = icon ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
const marker = icon ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement("i", {
|
||||||
className: 'material-icons small space-right' + (icon.color ? ' ' + icon.color : '')
|
className: 'material-icons small space-right' + (icon.color ? ' ' + icon.color : '')
|
||||||
@@ -8025,6 +8035,7 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'LN':
|
case 'LN':
|
||||||
|
case 'MN':
|
||||||
el = 'span';
|
el = 'span';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user