Skip to content

Commit

Permalink
Adds support for non-verified flag
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Dec 7, 2018
1 parent 87acb96 commit 8375d2a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ deps = {
"vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403",
"vendor/omaha": "https://github.com/brave/omaha.git@100a56f086078d6ed3a9166d48fea122be34b0f5",
"vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0",
"vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@7bd43e1b5e3d16f7a0374796110d42783a7ef7bd",
"vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@8d15acddb2cb6393622cfb7c6045b7884b15eba2",
"vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e",
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@9b119931c702d55be994117eb505d56310720b1d",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@adeff3254bb90ccdc9699040d5a4e1cd6b8393b7",
Expand Down
4 changes: 4 additions & 0 deletions browser/ui/webui/brave_rewards_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -525,18 +525,22 @@ void RewardsDOMHandler::SaveSetting(const base::ListValue* args) {

if (key == "contributionMinTime") {
rewards_service_->SetPublisherMinVisitTime(std::stoull(value));
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionMinVisits") {
rewards_service_->SetPublisherMinVisits(std::stoul(value));
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionNonVerified") {
rewards_service_->SetPublisherAllowNonVerified(value == "true");
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionVideos") {
rewards_service_->SetPublisherAllowVideos(value == "true");
OnContentSiteUpdated(rewards_service_);
}

if (key == "enabledContribute") {
Expand Down
4 changes: 4 additions & 0 deletions components/brave_rewards/browser/publisher_info_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ std::string PublisherInfoDatabase::BuildClauses(int start,
ledger::PUBLISHER_EXCLUDE_FILTER::FILTER_ALL_EXCEPT_EXCLUDED)
clauses += " AND pi.excluded != ?";

if (!filter.non_verified) {
clauses += " AND pi.verified = 1";
}

for (const auto& it : filter.order_by) {
clauses += " ORDER BY " + it.first;
clauses += (it.second ? " ASC" : " DESC");
Expand Down
1 change: 1 addition & 0 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ void RewardsServiceImpl::GetCurrentContributeList(
filter.reconcile_stamp = ledger_->GetReconcileStamp();
filter.excluded =
ledger::PUBLISHER_EXCLUDE_FILTER::FILTER_ALL_EXCEPT_EXCLUDED;
filter.non_verified = ledger_->GetPublisherAllowNonVerified();

ledger_->GetPublisherInfoList(
start,
Expand Down

0 comments on commit 8375d2a

Please sign in to comment.