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

Add profile user to Visit hook event args #26

Open
JDGrimes opened this issue Dec 31, 2016 · 6 comments
Open

Add profile user to Visit hook event args #26

JDGrimes opened this issue Dec 31, 2016 · 6 comments
Assignees

Comments

@JDGrimes
Copy link
Member

This will allow the Visit event to be used to award points to a user when somebody visits their profile.

The only issue is that right now there is no way to also prevent it from awarding points when they visit their own profile. But that is an upstream issue, partly.

@JDGrimes
Copy link
Member Author

Yeah, unless we add this restriction manually in the arg code or something, we shouldn't add this until it is possible for the user to impose this restriction themselves. If we hard-code this though, it will be difficult to maintain back-compat if we want to switch to soft-coding it later. Although really, I doubt that folks will ever want to award points to a user for visiting their own profile, specifically. But I could be wrong.

@JDGrimes
Copy link
Member Author

Maybe we are approaching this wrong though. This will award a user when somebody visits their profile, but can't be used to award the visitor for visiting a profile, specifically. So maybe we really want a Visit Profile event instead. But then, I don't know if that is really a feature that is needed or not.

@JDGrimes
Copy link
Member Author

JDGrimes commented Jan 3, 2017

If we hard-code this though, it will be difficult to maintain back-compat if we want to switch to soft-coding it later.

Actually, it isn't so much the back-compat as the fact that legacy users will be expecting it to behave the way that it did previously, which may cause problems. But really, like we said before, I doubt that awarding users for visiting their own profile will be a priority. And the same for awarding users for visiting a profile.

@JDGrimes
Copy link
Member Author

JDGrimes commented Jan 3, 2017

So for now, I guess we might as well add the arg to the Visit event, and limit it to only firing for users other than the current user.

@JDGrimes JDGrimes self-assigned this Jan 3, 2017
@JDGrimes
Copy link
Member Author

JDGrimes commented Jan 3, 2017

Note, however, that this event also fires when a user is not logged in, which would allow users to rack up points by logging out and then visiting their profile. This wouldn't be as big of an issue if there was a way for users to set a condition that would limit the reaction to firing only for logged-in users, but there currently isn't. (And really, even then users might not realize that they need to set that. Prompted me to create WordPoints/wordpoints#599. But I digress.) In some cases folks might want to award for visits from logged-out "guests", but in other cases this is just ripe for abuse.

@JDGrimes
Copy link
Member Author

JDGrimes commented Jan 5, 2017

Let's pursue some of these features in WordPoints, and then revisit this later when users will have more options.

@JDGrimes JDGrimes removed this from the 1.0.0 milestone Jan 5, 2017
JDGrimes added a commit that referenced this issue Jan 6, 2017
Was working on #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant