mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 11:21:25 -05:00
Added a valid link check
This commit is contained in:
parent
d508a8ea20
commit
f770f1fc8e
@ -578,12 +578,14 @@ void CreateGxsForumMsg::fileHashingFinished(QList<HashedFile> hashedFiles)
|
|||||||
{
|
{
|
||||||
QString encodedImage;
|
QString encodedImage;
|
||||||
uint32_t maxImageSize = 32000;
|
uint32_t maxImageSize = 32000;
|
||||||
|
if (link.valid()){
|
||||||
if (RsHtml::makeEmbeddedImage(hashedFile.filepath, encodedImage, 320*240, maxImageSize - 200 - link.toHtmlSize().length()))
|
if (RsHtml::makeEmbeddedImage(hashedFile.filepath, encodedImage, 320*240, maxImageSize - 200 - link.toHtmlSize().length()))
|
||||||
{ QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
{ QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
||||||
ui.forumMessage->textCursor().insertFragment(fragment);
|
ui.forumMessage->textCursor().insertFragment(fragment);
|
||||||
preview=true;
|
preview=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(!preview)
|
if(!preview)
|
||||||
{
|
{
|
||||||
QString image = FilesDefs::getImageFromFilename(hashedFile.filename, false);
|
QString image = FilesDefs::getImageFromFilename(hashedFile.filename, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user