some formatting fixes

This commit is contained in:
or-else
2021-12-11 21:49:03 -08:00
parent 69cf5817f0
commit afcb8d8616
7 changed files with 32 additions and 18 deletions
+10 -5
View File
@@ -847,18 +847,23 @@ class MessagesView extends React.Component {
uploader.cancel(); uploader.cancel();
} }
// seq: seq ID of the source message
// context: message content.
// forwarded: true if the source message is also a forwarded message.
// senderId: UID of the sender of the source 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) {
return; return;
} }
content = forwarded ? content = typeof content == 'string' ? Drafty.init(content) : content;
Drafty.forwardedContent(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.preview(content, QUOTED_REPLY_LENGTH, undefined, forwarded);
} else { } else {
// /!\ invalid content. // /!\ invalid content.
content = Drafty.append(Drafty.init('\u26A0 '), content = Drafty.append(Drafty.init('\u26A0 '),
@@ -990,7 +995,7 @@ class MessagesView extends React.Component {
<ChatMessage <ChatMessage
tinode={this.props.tinode} tinode={this.props.tinode}
content={msg.content} content={msg.content}
forwarded={msg.head ? msg.head.forwarded : null} forwarded={msg.head ? !!msg.head.forwarded : null}
deleted={msg.hi} deleted={msg.hi}
mimeType={msg.head ? msg.head.mime : null} mimeType={msg.head ? msg.head.mime : null}
timestamp={msg.ts} timestamp={msg.ts}
+4 -3
View File
@@ -4166,6 +4166,7 @@ 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
}); });
@@ -4174,10 +4175,10 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
return; return;
} }
content = forwarded ? Drafty.forwardedContent(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.preview(content, _config_js__WEBPACK_IMPORTED_MODULE_14__.QUOTED_REPLY_LENGTH, undefined, forwarded);
} 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'));
} }
@@ -4325,7 +4326,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
messageNodes.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_chat_message_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { messageNodes.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_chat_message_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
tinode: this.props.tinode, tinode: this.props.tinode,
content: msg.content, content: msg.content,
forwarded: msg.head ? msg.head.forwarded : null, forwarded: msg.head ? !!msg.head.forwarded : null,
deleted: msg.hi, deleted: msg.hi,
mimeType: msg.head ? msg.head.mime : null, mimeType: msg.head ? msg.head.mime : null,
timestamp: msg.ts, timestamp: msg.ts,
+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
+14 -6
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