-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Show real mail in Webhooks #27943
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
Show real mail in Webhooks #27943
Conversation
I don't like that solution. You could get the same result with a simple |
That's not ignored. If the User has enabled hiding the address, it will still be hidden. |
How about using
Correct, my bad. |
Repo was only a example. There are other objects like Issues or PullRequests, so this would involve a lot of work. Using the context is just the easiest way and I see no problems with this. I'm also not sure if a new Permission mode is the right place for that. |
The context is the same as a global variable and using it here for control flow is bad design. |
A context is not for global variables. the variables are just used within this context and are passed down the line. |
Sure, still the context acts like a global variable (or thread local if you want) and you use it to pass variables down the callstack. That's a typical anti pattern. https://news.ycombinator.com/item?id=24323564
https://medium.com/@gosamv/context-patterns-antipatterns-6bc48eaf774e
|
I think in this case using a context is OK.
|
What do you think about " Fix missed doer #30231 " ? I think 30231 looks better and more intuitive |
Regression of #25097
Fixes #27918
The API should not return the real mail of a User, if you are not logged in. Webhooks however should show the real mail. As
toUser()
is used in a lot of places, I decided that it is easier to just use a context variable to identify if the context belongs to a Webhook than refactoring half Gitea to pass an argument.