mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 02:44:20 -05:00
gxsforums: make forum's messages respectful to chat options
e.g. to font size. Concerns only the output of messages.
This commit is contained in:
parent
4c626e04a1
commit
fdeb727fc1
@ -1695,22 +1695,31 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
|
|||||||
ui->by_text_label->show();
|
ui->by_text_label->show();
|
||||||
ui->by_label->show();
|
ui->by_label->show();
|
||||||
|
|
||||||
if(redacted)
|
if(redacted) {
|
||||||
{
|
|
||||||
QString extraTxt = tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())) ;
|
QString extraTxt = tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())) ;
|
||||||
extraTxt += tr( "<UL><li><b><font color=\"#ff0000\">Messages from this author are not forwarded. </font></b></li>") ;
|
extraTxt += tr( "<UL><li><b><font color=\"#ff0000\">Messages from this author are not forwarded. </font></b></li>") ;
|
||||||
extraTxt += tr( "<li><b><font color=\"#ff0000\">Messages from this author are replaced by this text. </font></b></li></ul>") ;
|
extraTxt += tr( "<li><b><font color=\"#ff0000\">Messages from this author are replaced by this text. </font></b></li></ul>") ;
|
||||||
extraTxt += tr( "<p><b><font color=\"#ff0000\">You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.</font></b></p>") ;
|
extraTxt += tr( "<p><b><font color=\"#ff0000\">You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.</font></b></p>") ;
|
||||||
|
|
||||||
ui->postText->setHtml(extraTxt) ;
|
ui->postText->setHtml(extraTxt) ;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
uint32_t flags = RSHTML_FORMATTEXT_EMBED_LINKS;
|
uint32_t flags = RSHTML_FORMATTEXT_EMBED_LINKS;
|
||||||
if(Settings->getForumLoadEmoticons())
|
if(Settings->getForumLoadEmoticons())
|
||||||
flags |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
|
flags |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
|
||||||
|
flags |= RSHTML_OPTIMIZEHTML_MASK;
|
||||||
|
|
||||||
QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()),flags);
|
QColor backgroundColor = ui->postText->palette().base().color();
|
||||||
|
qreal desiredContrast = Settings->valueFromGroup("Chat",
|
||||||
|
"MinimumContrast", 4.5).toDouble();
|
||||||
|
int desiredMinimumFontSize = Settings->valueFromGroup("Chat",
|
||||||
|
"MinimumFontSize", 10).toInt();
|
||||||
|
|
||||||
|
QString extraTxt = RsHtml().formatText(ui->postText->document(),
|
||||||
|
QString::fromUtf8(msg.mMsg.c_str()), flags
|
||||||
|
#ifndef DEBUG_FORUMS \
|
||||||
|
, backgroundColor, desiredContrast, desiredMinimumFontSize
|
||||||
|
#endif
|
||||||
|
);
|
||||||
ui->postText->setHtml(extraTxt);
|
ui->postText->setHtml(extraTxt);
|
||||||
}
|
}
|
||||||
// ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str()));
|
// ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str()));
|
||||||
|
Loading…
Reference in New Issue
Block a user