@@ -288,10 +288,14 @@ void Publisher::SaveVisitInternal(
288
288
bool is_verified = IsConnectedOrVerified (status);
289
289
290
290
bool new_publisher = false ;
291
+ bool updated_publisher = false ;
291
292
if (!publisher_info) {
292
293
new_publisher = true ;
293
294
publisher_info = type::PublisherInfo::New ();
294
295
publisher_info->id = publisher_key;
296
+ } else if (publisher_info->name != visit_data.name ||
297
+ publisher_info->url != visit_data.url ) {
298
+ updated_publisher = true ;
295
299
}
296
300
297
301
std::string fav_icon = visit_data.favicon_url ;
@@ -337,22 +341,18 @@ void Publisher::SaveVisitInternal(
337
341
bool verified_new = !allow_non_verified && !is_verified;
338
342
bool verified_old = allow_non_verified || is_verified;
339
343
340
- if (new_publisher &&
341
- (excluded ||
342
- !ledger_->state ()->GetAutoContributeEnabled () ||
343
- min_duration_new ||
344
- verified_new)) {
344
+ if ((new_publisher || updated_publisher) &&
345
+ (excluded || !ledger_->state ()->GetAutoContributeEnabled () ||
346
+ min_duration_new || verified_new)) {
345
347
panel_info = publisher_info->Clone ();
346
348
347
349
auto callback = std::bind (&Publisher::OnPublisherInfoSaved,
348
350
this ,
349
351
_1);
350
352
351
353
ledger_->database ()->SavePublisherInfo (std::move (publisher_info), callback);
352
- } else if (!excluded &&
353
- ledger_->state ()->GetAutoContributeEnabled () &&
354
- min_duration_ok &&
355
- verified_old) {
354
+ } else if (!excluded && ledger_->state ()->GetAutoContributeEnabled () &&
355
+ min_duration_ok && verified_old) {
356
356
if (first_visit) {
357
357
publisher_info->visits += 1 ;
358
358
}
0 commit comments