fixed clicking on external url in MessageWidget

This commit is contained in:
csoler 2018-08-01 20:31:48 +02:00
parent 0d4eafde31
commit 50867d2503
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -28,6 +28,7 @@
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#include <QTextCodec> #include <QTextCodec>
#include <QDesktopServices>
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "gui/RetroShareLink.h" #include "gui/RetroShareLink.h"
@ -756,18 +757,19 @@ void MessageWidget::anchorClicked(const QUrl &url)
{ {
RetroShareLink link(url); RetroShareLink link(url);
if (link.valid() == false) { if(link.valid())
return; {
if (link.type() == RetroShareLink::TYPE_CERTIFICATE && currMsgFlags & RS_MSG_USER_REQUEST) {
std::cerr << "(WW) Calling some disabled code in MessageWidget::anchorClicked(). Please contact the developpers." << std::endl;
// link.setSubType(RSLINK_SUBTYPE_CERTIFICATE_USER_REQUEST);
}
QList<RetroShareLink> links;
links.append(link);
RetroShareLink::process(links);
} }
else
if (link.type() == RetroShareLink::TYPE_CERTIFICATE && currMsgFlags & RS_MSG_USER_REQUEST) { QDesktopServices::openUrl(url) ;
std::cerr << "(WW) Calling some disabled code in MessageWidget::anchorClicked(). Please contact the developpers." << std::endl;
// link.setSubType(RSLINK_SUBTYPE_CERTIFICATE_USER_REQUEST);
}
QList<RetroShareLink> links;
links.append(link);
RetroShareLink::process(links);
} }
void MessageWidget::loadImagesAlways() void MessageWidget::loadImagesAlways()