Skip to content
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

Reddit publishers now appear correctly in publisher panel when account is set to hide from robots #2635

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Jun 7, 2019

Fixes brave/brave-browser#4754

Submitter Checklist:

Test Plan:

  1. Open Brave with Rewards enabled.
  2. Visit a Reddit user page that has 'hide from robots' turned on.
    (use reddit.com/u/jsadler-brave as an example of search indexing turned off)
  3. Ensure publisher info displays in panel

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@@ -194,9 +194,10 @@ std::string MediaReddit::GetUserId(const std::string& response) {
if (response.empty()) {
return std::string();
}

std::string pattern(ExtractData(response, "hideFromRobots\":",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please use std::string pattern = and const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -194,9 +194,10 @@ std::string MediaReddit::GetUserId(const std::string& response) {
if (response.empty()) {
return std::string();
}

std::string pattern(ExtractData(response, "hideFromRobots\":",
"\"isEmployee\""));
std::string id(braveledger_media::ExtractData(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please use std::string id =

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jasonrsadler jasonrsadler force-pushed the reddit_fixup branch 3 times, most recently from 6109edb to dc4a7af Compare June 7, 2019 12:36
NejcZdovc
NejcZdovc previously approved these changes Jun 7, 2019

std::string id(braveledger_media::ExtractData(
response, "hideFromRobots\":false,\"id\":\"t2_", "\""));
const std::string pattern = ExtractData(response, "hideFromRobots\":",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we always use braveledger_media:: ExtractData

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reddit pubisher not displaying when account set to hide from robots
2 participants