diff --git a/components/brave_rewards/browser/publisher_info_database.cc b/components/brave_rewards/browser/publisher_info_database.cc index 48af188c99bf..a744dbb693aa 100644 --- a/components/brave_rewards/browser/publisher_info_database.cc +++ b/components/brave_rewards/browser/publisher_info_database.cc @@ -483,6 +483,10 @@ std::string PublisherInfoDatabase::BuildClauses(int start, ledger::PUBLISHER_EXCLUDE_FILTER::FILTER_ALL_EXCEPT_EXCLUDED) clauses += " AND pi.excluded != ?"; + if (filter.percent > 0) { + clauses += " AND ai.percent >= ?"; + } + for (const auto& it : filter.order_by) { clauses += " ORDER BY " + it.first; clauses += (it.second ? " ASC" : " DESC"); @@ -528,6 +532,9 @@ void PublisherInfoDatabase::BindFilter(sql::Statement& statement, if (filter.excluded == ledger::PUBLISHER_EXCLUDE_FILTER::FILTER_ALL_EXCEPT_EXCLUDED) statement.BindInt(column++, ledger::PUBLISHER_EXCLUDE::EXCLUDED); + + if (filter.percent > 0) + statement.BindInt(column++, filter.percent); } bool PublisherInfoDatabase::InsertContributionInfo(const brave_rewards::ContributionInfo& info) { diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 6b7eb090f5c5..75b22c054c2c 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -360,6 +360,7 @@ void RewardsServiceImpl::GetCurrentContributeList( filter.reconcile_stamp = ledger_->GetReconcileStamp(); filter.excluded = ledger::PUBLISHER_EXCLUDE_FILTER::FILTER_ALL_EXCEPT_EXCLUDED; + filter.percent = 1; ledger_->GetPublisherInfoList( start, diff --git a/vendor/bat-native-ledger/include/bat/ledger/publisher_info.h b/vendor/bat-native-ledger/include/bat/ledger/publisher_info.h index bd7e2e5d3fd1..4159bfff489a 100644 --- a/vendor/bat-native-ledger/include/bat/ledger/publisher_info.h +++ b/vendor/bat-native-ledger/include/bat/ledger/publisher_info.h @@ -62,6 +62,7 @@ LEDGER_EXPORT struct PublisherInfoFilter { PUBLISHER_MONTH month; int year; PUBLISHER_EXCLUDE_FILTER excluded; + uint32_t percent; std::vector> order_by; unsigned int min_duration; uint64_t reconcile_stamp; diff --git a/vendor/bat-native-ledger/src/bat/ledger/ledger.cc b/vendor/bat-native-ledger/src/bat/ledger/ledger.cc index 18f18173f8b1..952a3bd397bb 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/ledger.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/ledger.cc @@ -88,6 +88,7 @@ PublisherInfoFilter::PublisherInfoFilter() : month(PUBLISHER_MONTH::ANY), year(-1), excluded(PUBLISHER_EXCLUDE_FILTER::FILTER_DEFAULT), + percent(0), min_duration(0), reconcile_stamp(0) {} PublisherInfoFilter::PublisherInfoFilter(const PublisherInfoFilter& filter) : @@ -96,6 +97,7 @@ PublisherInfoFilter::PublisherInfoFilter(const PublisherInfoFilter& filter) : month(filter.month), year(filter.year), excluded(filter.excluded), + percent(filter.percent), order_by(filter.order_by), min_duration(filter.min_duration), reconcile_stamp(filter.reconcile_stamp) {}