This commit is contained in:
or-else
2021-09-12 12:23:14 -07:00
parent 531a7ed74a
commit f57c5736e6
9 changed files with 579 additions and 593 deletions
+9 -1
View File
@@ -93,6 +93,7 @@ class MessagesView extends React.Component {
this.leave = this.leave.bind(this);
this.sendMessage = this.sendMessage.bind(this);
this.retrySend = this.retrySend.bind(this);
this.sendImageAttachment = this.sendImageAttachment.bind(this);
this.sendFileAttachment = this.sendFileAttachment.bind(this);
this.sendKeyPress = this.sendKeyPress.bind(this);
@@ -365,7 +366,7 @@ class MessagesView extends React.Component {
// If there are unsent messages, try sending them now.
topic.queuedMessages((pub) => {
if (!pub._sending && topic.isSubscribed()) {
this.sendMessage(pub);
this.retrySend(pub);
}
});
})
@@ -684,6 +685,11 @@ class MessagesView extends React.Component {
this.props.sendMessage(msg, uploadCompletionPromise, uploader, head);
}
// Retry sending a message.
retrySend(pub) {
this.props.sendMessage(pub.content, undefined, undefined, pub.head);
}
// Send attachment as Drafty message:
// - if file is too large, upload it and send a s link.
// - if file is small enough, just send it in-band.
@@ -1315,6 +1321,8 @@ function draftyFormatter(style, data, values, key) {
el = UploadingImage;
}
}
// Image element cannot have content.
values = null;
break;
case 'BN':
// Button