[Glitch] Add limited attribute to accounts in REST API and a warning in web UI

Port b4d373a3df to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2022-05-10 09:44:35 +02:00
committed by Claire
parent bb1a3e902d
commit 6fb837aa1d
12 changed files with 143 additions and 37 deletions

View File

@ -194,3 +194,11 @@ export const getAccountGallery = createSelector([
return medias;
});
export const getAccountHidden = createSelector([
(state, id) => state.getIn(['accounts', id, 'hidden']),
(state, id) => state.getIn(['relationships', id, 'following']) || state.getIn(['relationships', id, 'requested']),
(state, id) => id === me,
], (hidden, followingOrRequested, isSelf) => {
return hidden && !(isSelf || followingOrRequested);
});