use new method for replies

This commit is contained in:
or-else
2021-12-19 11:51:24 -08:00
parent 9582a9f2cd
commit 1d59d29519
7 changed files with 45 additions and 41 deletions
+1 -3
View File
@@ -853,8 +853,6 @@ class MessagesView extends React.Component {
// senderId: UID of the sender of the source message. // senderId: UID of the sender of the source message.
// senderName: full name of the sender of the original message. // senderName: full name of the sender of the original message.
handlePickReply(seq, content, forwarded, senderId, senderName) { handlePickReply(seq, content, forwarded, senderId, senderName) {
console.log("forwarded message:", forwarded);
this.setState({reply: null}); this.setState({reply: null});
if (!seq || !content) { if (!seq || !content) {
@@ -863,7 +861,7 @@ class MessagesView extends React.Component {
content = typeof content == 'string' ? Drafty.init(content) : content; content = typeof content == 'string' ? Drafty.init(content) : content;
if (Drafty.isValid(content)) { if (Drafty.isValid(content)) {
content = Drafty.preview(content, QUOTED_REPLY_LENGTH, undefined, forwarded); content = Drafty.replyContent(content, QUOTED_REPLY_LENGTH);
} else { } else {
// /!\ invalid content. // /!\ invalid content.
content = Drafty.append(Drafty.init('\u26A0 '), content = Drafty.append(Drafty.init('\u26A0 '),
+2 -8
View File
@@ -611,16 +611,10 @@ function fullFormatter(style, data, values, key) {
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(el, attr, values); return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(el, attr, values);
} }
function previewFormatter(style, data, values, key) { function previewFormatter(style, data, values, key) {
console.log("Formatting (s, d, v, k):", style, data, values, key);
if (!style) { if (!style) {
return values; return values;
} }
if (style == 'HD') {
return null;
}
let el = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.tagName(style); let el = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.tagName(style);
const attr = { const attr = {
key: key key: key
@@ -684,6 +678,7 @@ function previewFormatter(style, data, values, key) {
break; break;
case 'QQ': case 'QQ':
case 'HD':
el = null; el = null;
values = null; values = null;
break; break;
@@ -4166,7 +4161,6 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
} }
handlePickReply(seq, content, forwarded, senderId, senderName) { handlePickReply(seq, content, forwarded, senderId, senderName) {
console.log("forwarded message:", forwarded);
this.setState({ this.setState({
reply: null reply: null
}); });
@@ -4178,7 +4172,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
content = typeof content == 'string' ? Drafty.init(content) : content; content = typeof content == 'string' ? Drafty.init(content) : content;
if (Drafty.isValid(content)) { if (Drafty.isValid(content)) {
content = Drafty.preview(content, _config_js__WEBPACK_IMPORTED_MODULE_14__.QUOTED_REPLY_LENGTH, undefined, forwarded); content = Drafty.replyContent(content, _config_js__WEBPACK_IMPORTED_MODULE_14__.QUOTED_REPLY_LENGTH);
} else { } else {
content = Drafty.append(Drafty.init('\u26A0 '), Drafty.wrapInto(this.props.intl.formatMessage(messages.invalid_content), 'EM')); content = Drafty.append(Drafty.init('\u26A0 '), Drafty.wrapInto(this.props.intl.formatMessage(messages.invalid_content), 'EM'));
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+38 -26
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long