Index: src/engine/Main.cpp |
=================================================================== |
--- a/src/engine/Main.cpp |
+++ b/src/engine/Main.cpp |
@@ -88,11 +88,12 @@ |
case Communication::PROC_MATCHES: |
{ |
std::string url; |
- std::string type; |
+ int32_t type; |
std::string documentUrl; |
request >> url >> type >> documentUrl; |
- referrerMapping.Add(url, documentUrl); |
- AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referrerMapping.BuildReferrerChain(documentUrl)); |
+ referrerMapping.Add(url, documentUrl); |
+ auto contentType = static_cast<AdblockPlus::FilterEngine::ContentType>(type); |
+ AdblockPlus::FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildReferrerChain(documentUrl)); |
response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -192,7 +193,8 @@ |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_DOCUMENT, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -200,8 +202,13 @@ |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "ELEMHIDE", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_ELEMHIDE, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
+ if (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION) |
+ { |
+ std::string(); |
+ } |
break; |
} |
case Communication::PROC_ADD_FILTER: |