users: rework privacy mode into private favorites (fix #4257).

* Rename 'privacy mode' to 'private favorites'.
* Make the private favorites setting only hide favorites, not favgroups
  and not the user's uploads on their profile page.
* Make the favgroup is_public flag default to true instead of false and
  fix existing favgroups to be public if the user didn't have privacy mode
  enabled before.
* List _all_ public favgroups on the /favorite_groups index, not just
  favgroups belonging to the current user.
* Add a /users/<id>/favorite_groups endpoint.
This commit is contained in:
evazion
2020-01-17 19:59:47 -06:00
parent 2095dd3084
commit 4a7322b197
15 changed files with 44 additions and 38 deletions

View File

@@ -924,7 +924,7 @@ CREATE TABLE public.favorite_groups (
post_ids integer[] DEFAULT '{}'::integer[] NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
is_public boolean DEFAULT false NOT NULL
is_public boolean DEFAULT true NOT NULL
);
@@ -4967,6 +4967,13 @@ CREATE INDEX index_dtext_links_on_model_type_and_model_id ON public.dtext_links
CREATE INDEX index_favorite_groups_on_creator_id ON public.favorite_groups USING btree (creator_id);
--
-- Name: index_favorite_groups_on_is_public; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_favorite_groups_on_is_public ON public.favorite_groups USING btree (is_public);
--
-- Name: index_favorite_groups_on_lower_name; Type: INDEX; Schema: public; Owner: -
--
@@ -7407,6 +7414,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20191119061018'),
('20191223032633'),
('20200114204550'),
('20200115010442');
('20200115010442'),
('20200118015014');