From 844aa174b53563735f7dfe9a68520f6104250a5d Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 10 Jun 2011 21:16:38 +0000 Subject: [PATCH] send plain text message instead of html, when the text contains no html specifics. This is a huge gain in forum posts size, up to a factor of 50 git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4247 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/forums/CreateForumMsg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp index 9adf342b0..7f4a391a9 100644 --- a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp +++ b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp @@ -144,6 +144,12 @@ void CreateForumMsg::createMsg() QString name = misc::removeNewLine(ui.forumSubject->text()); QString desc = ui.forumMessage->toHtml(); + if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml()) + { + desc = ui.forumMessage->toPlainText() ; + std::cerr << "Optimized forum message to " << desc.length() << " bytes , instead of " << ui.forumMessage->toHtml().length() << std::endl; + } + if(name.isEmpty()) { /* error message */ QMessageBox::warning(this, tr("RetroShare"),tr("Please set a Forum Subject and Forum Message"),