mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-16 19:28:48 -04:00
Added a valid link check
This commit is contained in:
parent
d508a8ea20
commit
f770f1fc8e
1 changed files with 6 additions and 4 deletions
|
@ -578,10 +578,12 @@ void CreateGxsForumMsg::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||||
{
|
{
|
||||||
QString encodedImage;
|
QString encodedImage;
|
||||||
uint32_t maxImageSize = 32000;
|
uint32_t maxImageSize = 32000;
|
||||||
if (RsHtml::makeEmbeddedImage(hashedFile.filepath, encodedImage, 320*240, maxImageSize - 200 - link.toHtmlSize().length()))
|
if (link.valid()){
|
||||||
{ QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
if (RsHtml::makeEmbeddedImage(hashedFile.filepath, encodedImage, 320*240, maxImageSize - 200 - link.toHtmlSize().length()))
|
||||||
ui.forumMessage->textCursor().insertFragment(fragment);
|
{ QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);
|
||||||
preview=true;
|
ui.forumMessage->textCursor().insertFragment(fragment);
|
||||||
|
preview=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!preview)
|
if(!preview)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue