Commit f64bc6a0 authored by Laurent Montel's avatar Laurent Montel 😁

Don't expand when not necessary

parent c362da00
......@@ -17,6 +17,8 @@
#include "viewerpluginexpandurlinterface.h"
#include <MessageViewer/ScamExpandUrlJob>
#include <MessageViewer/ScamCheckShortUrlManager>
#include <MessageViewer/ScamCheckShortUrl>
#include <QHBoxLayout>
#include <QIcon>
......@@ -47,8 +49,10 @@ QAction *ViewerPluginExpandurlInterface::action() const
void ViewerPluginExpandurlInterface::showWidget()
{
if (mCurrentUrl.isValid()) {
MessageViewer::ScamExpandUrlJob *job = new MessageViewer::ScamExpandUrlJob(this);
job->expandedUrl(mCurrentUrl);
if (MessageViewer::ScamCheckShortUrlManager::self()->scamCheckShortUrl()->isShortUrl(mCurrentUrl)) {
MessageViewer::ScamExpandUrlJob *job = new MessageViewer::ScamExpandUrlJob(this);
job->expandedUrl(mCurrentUrl);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment