mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-27 01:03:51 -05:00
Visibility of replies now more restrictive by default
Formerly, the visibility of replies defaulted to the visibility of the post they were in reply to. Now they default to the more restrictive of the visibility of the post they were in reply to, or your account's default visibility. This should be less surprising for people with more restrictive default visibility settings.
This commit is contained in:
parent
be78053179
commit
9af914db85
@ -37,6 +37,8 @@ class NotLoggedInException(Exception):
|
||||
global sessons_cache
|
||||
sessions_cache = {}
|
||||
|
||||
VISIBILITIES = ["direct", "private", "unlisted", "public"]
|
||||
|
||||
###
|
||||
### Utility functions
|
||||
###
|
||||
@ -164,6 +166,12 @@ def user_search_inner(request, query):
|
||||
)
|
||||
|
||||
|
||||
def min_visibility(visibility1, visibility2):
|
||||
return VISIBILITIES[
|
||||
min(VISIBILITIES.index(visibility1), VISIBILITIES.index(visibility2))
|
||||
]
|
||||
|
||||
|
||||
def timeline(
|
||||
request,
|
||||
timeline="home",
|
||||
@ -1012,7 +1020,9 @@ def reply(request, id):
|
||||
form = PostForm(
|
||||
initial={
|
||||
"status": initial_text,
|
||||
"visibility": toot.visibility,
|
||||
"visibility": min_visibility(
|
||||
toot.visibility, request.session["active_user"].source.privacy
|
||||
),
|
||||
"spoiler_text": toot.spoiler_text,
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user