|
|
|
|
@ -264,7 +264,7 @@ quint64 InputBar::beginReplySend(const QByteArray& reply, quint64 generation, co
|
|
|
|
|
const QString& text, const QString& source) { |
|
|
|
|
if (reply.isEmpty()) return 0; |
|
|
|
|
const quint64 request = ++m_submissionSequence; |
|
|
|
|
m_pendingReplies.insert(request, {generation, target, text, source, m_input->document()->revision()}); |
|
|
|
|
m_pendingReplies.insert(request, {generation, target, text, source, m_input->document()->revision(), m_attachmentRevision}); |
|
|
|
|
GUI_DEBUG("reply: submit ch=%s id=%s request=%llu", qPrintable(target), reply.toHex().constData(), (unsigned long long)request); |
|
|
|
|
return request; |
|
|
|
|
} |
|
|
|
|
@ -281,8 +281,8 @@ void InputBar::submissionResult(quint64 request, bool success) {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!pending.text.isEmpty() && pending.textRevision == m_input->document()->revision()) m_input->clear(); |
|
|
|
|
if (!pending.source.isEmpty() && pending.source == m_pendingAttachSrc) clearPendingAttachment(); |
|
|
|
|
if (!replySending() && !m_replyFailed) clearReply(); |
|
|
|
|
if (!pending.source.isEmpty() && pending.attachmentRevision == m_attachmentRevision) clearPendingAttachment(); |
|
|
|
|
if (!replySending() && !m_replyFailed && m_input->toPlainText().isEmpty() && m_pendingAttachSrc.isEmpty()) clearReply(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Qt доставляет drop в viewport, а не в QTextEdit/QListView. Родитель composer принимает drop на кнопках. */ |
|
|
|
|
@ -558,6 +558,7 @@ bool InputBar::prepareAttachment(const QString& srcPath, quint64 context) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
m_pendingAttachSrc = srcPath; |
|
|
|
|
++m_attachmentRevision; |
|
|
|
|
m_pendingAttachDest = destPath; |
|
|
|
|
m_pendingAttachName = fi.fileName(); |
|
|
|
|
m_pendingAttachSize = fi.size(); |
|
|
|
|
@ -576,6 +577,7 @@ bool InputBar::prepareAttachment(const QString& srcPath, quint64 context) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void InputBar::clearPendingAttachment() { |
|
|
|
|
++m_attachmentRevision; |
|
|
|
|
m_pendingAttachSrc.clear(); |
|
|
|
|
m_pendingAttachDest.clear(); |
|
|
|
|
m_pendingAttachName.clear(); |
|
|
|
|
|