mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
send msg in plain text when the html encoding does not change anything into the message. This drastically reduces messages size.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4599 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b73fd06753
commit
dc0f4ef68a
@ -1164,6 +1164,13 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
mi.title = misc::removeNewLine(ui.titleEdit->text()).toStdWString();
|
||||
mi.msg = ui.msgText->toHtml().toStdWString();
|
||||
|
||||
if(ui.msgText->toHtml() == QTextDocument(ui.msgText->toPlainText()).toHtml())
|
||||
{
|
||||
mi.msg = ui.msgText->toPlainText().toStdWString() ;
|
||||
std::cerr << "Optimized forum message to " << mi.msg.length() << " bytes , instead of " << ui.msgText->toHtml().length() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
/* check for existing title */
|
||||
if (bDraftbox == false && mi.title.empty()) {
|
||||
if (QMessageBox::warning(this, tr("RetroShare"), tr("Do you want to send the message without a subject ?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {
|
||||
|
Loading…
Reference in New Issue
Block a user