Fix attachment sending, media manifests and storage defaults
This commit is contained in:
1 parent
99e5a27bdb
commit
e22ed44b17
15 files changed
+157
-47
No files matched your search
@@ -279,7 +279,7 @@ bool InputBar::submissionPending() const {
|
||||
/* Канальный текст и каждая часть ответа имеют собственное подтверждение и снимок черновика. */
|
||||
quint64 InputBar::beginSubmission(const QByteArray& reply, quint64 generation, const QString& target,
|
||||
const QString& text, const QString& source) {
|
||||
if (reply.isEmpty() && text.isEmpty()) return 0;
|
||||
if (reply.isEmpty() && text.isEmpty() && (source.isEmpty() || m_dmMode)) return 0;
|
||||
const quint64 request = ++s_submissionSequence;
|
||||
m_pendingSubmissions.insert(request, {generation, target, text, source, m_input->document()->revision(), m_attachmentRevision});
|
||||
GUI_DEBUG("send: pending ch=%s reply=%s request=%llu", qPrintable(target), reply.toHex().constData(), (unsigned long long)request);
|
||||
@@ -308,7 +308,11 @@ void InputBar::submissionResult(quint64 request, bool success) {
|
||||
if (!success) {
|
||||
m_submissionFailed = true;
|
||||
GUI_ERROR("send: submission failed ch=%s request=%llu", qPrintable(pending.target), (unsigned long long)request);
|
||||
emit attachmentRejected(QCoreApplication::translate("ChatGui", "Could not send message. Please try again."));
|
||||
const QString error = pending.source.isEmpty()
|
||||
? QCoreApplication::translate("ChatGui", "Could not send message. Please try again.")
|
||||
: QCoreApplication::translate("ChatGui", "Could not send attachment \"%1\". Please try again.")
|
||||
.arg(QFileInfo(pending.source).fileName());
|
||||
emit attachmentRejected(error);
|
||||
return;
|
||||
}
|
||||
if (!pending.text.isEmpty() && pending.textRevision == m_input->document()->revision()) m_input->clear();
|
||||
@@ -521,7 +525,7 @@ void InputBar::onSendClicked() {
|
||||
}
|
||||
if (!alive || context != m_attachmentContext) return;
|
||||
if (m_submissionFailed) return;
|
||||
if (reply.isEmpty()) clearPendingAttachment();
|
||||
if (!requestId) clearPendingAttachment();
|
||||
}
|
||||
if (!text.isEmpty()) {
|
||||
const quint64 request = beginSubmission(reply, m_replyGeneration, m_channelIdForRecord, text);
|
||||
|
||||
Reference in new issue
Block a user