Hotfix for anonymous Mail #214
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes problem adressed in #211, #202.
What was the problem?
It was a really funny problem. In the process of sending a notification mail of a new post, it's being checked twice (in different files and contexts) if the author of the post should be anonymous. Both checks function perfectly. The problem was, that the algorithm set the user-id to a negative integer after a first successful anonymous check. The second check works with the changed user-id integer and compares it to the original post user-id. Since the user-ids are not equal, the user was wrongly set as "non-anonymous". This happened especially in half-anonymous forums, as in those the anonymous status is being checked by user-id.
What is the solution?
After the first check, the anonymous status of the author is being saved in a variable. The second anonymous check is being replaced by simply checking the previous set variable.
Important!
This is only a hotfix. The email-system still needs a redesign that can be followed on #212.