-
Notifications
You must be signed in to change notification settings - Fork 965
Implement additional ad event confirmations #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
int total_viewed = 0; | ||
|
||
for (const auto& transaction : info->transactions) { | ||
if (transaction.confirmation_type != "view") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this string into variable, so that we have it only in one place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
writer.String(time_stamp.c_str()); | ||
|
||
writer.String("notificationId"); | ||
writer.String(info.uuid.c_str()); | ||
|
||
std::string type; | ||
switch (info.type) { | ||
case ConfirmationType::UNKNOWN: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract all this types into variable? (same as comment above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
@@ -71,6 +76,21 @@ Result NotificationInfo::FromJson( | |||
uuid = document["uuid"].GetString(); | |||
} | |||
|
|||
if (document.HasMember("confirmation_type")) { | |||
std::string confirmation_type = document["confirmation_type"].GetString(); | |||
if (confirmation_type == "click") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
break; | ||
} | ||
|
||
case ConfirmationType::CLICK: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
break; | ||
} | ||
|
||
case ConfirmationType::CLICK: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
break; | ||
} | ||
|
||
case ConfirmationType::CLICK: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 fixed
a808b3e
to
b416870
Compare
5518141
to
8f460b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fixes brave/brave-browser#3587
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests
) onnpm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: