Although I agree we should focus on public posts first, I strongly approve to do it for limited posts later.
When the URL is requested, here is what is happening on the server:
- The ID of the post (
:id) will give the contacts of everyone involved in the post (post author + comments authors) + the list of contacts the author allowed for the post (the visibility list)
- Then the ID of the user (
:user_handle) will give its contact list
- We intersect the visibility list with the user’s contact list; we get the list of user’s contacts that can actually see the post
- We merge 1. and 3.
- We remove the user itself
- The result is the list of contacts the user can mention in his comment.