diff --git a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp index 32ca0c34a..2a4fadde6 100644 --- a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp @@ -353,8 +353,6 @@ void ForumMsgItem::sendMsg() return; } - QString desc = textEdit->toHtml(); - if(textEdit->toPlainText().isEmpty()) { /* error message */ QMessageBox::warning(this, "RetroShare",tr("Please give a Text Message"), @@ -382,6 +380,9 @@ void ForumMsgItem::sendMsg() msgInfo.title = L"Re: " + msg.title; } + QString desc; + RsHtml::optimizeHtml(textEdit, desc); + msgInfo.msg = desc.toStdWString(); msgInfo.msgflags = 0; diff --git a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp index a222daaff..747d89dd3 100644 --- a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp +++ b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp @@ -35,6 +35,7 @@ #include "gui/RetroShareLink.h" #include "gui/common/Emoticons.h" +#include "util/HandleRichText.h" #include "util/misc.h" #include @@ -153,10 +154,9 @@ void CreateForumMsg::newMsg() void CreateForumMsg::createMsg() { QString name = misc::removeNewLine(ui.forumSubject->text()); - QString desc = ui.forumMessage->toHtml(); + QString desc; - if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml()) - desc = ui.forumMessage->toPlainText() ; + RsHtml::optimizeHtml(ui.forumMessage, desc); if(name.isEmpty()) { /* error message */ diff --git a/retroshare-gui/src/gui/forumsv2/CreateForumV2Msg.cpp b/retroshare-gui/src/gui/forumsv2/CreateForumV2Msg.cpp index b6a0ec6d6..5bc3af714 100644 --- a/retroshare-gui/src/gui/forumsv2/CreateForumV2Msg.cpp +++ b/retroshare-gui/src/gui/forumsv2/CreateForumV2Msg.cpp @@ -35,6 +35,7 @@ #include "gui/RetroShareLink.h" #include "gui/common/Emoticons.h" +#include "util/HandleRichText.h" #include "util/misc.h" #include @@ -224,10 +225,9 @@ void CreateForumV2Msg::loadFormInformation() void CreateForumV2Msg::createMsg() { QString name = misc::removeNewLine(ui.forumSubject->text()); - QString desc = ui.forumMessage->toHtml(); + QString desc; - if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml()) - desc = ui.forumMessage->toPlainText() ; + RsHtml::optimizeHtml(ui.forumMessage, desc); if(name.isEmpty()) { /* error message */