mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 11:31:01 +00:00
fdfeeed6d9
Add some support for comment visibility, fix #217 This add a new column to comment, denoting if they are public or not, and a new table linking private comments to those allowed to read them. There is currently no way to write a private comment from Plume. Git is having a hard time what happened in Comment::from_activity, but most of it is just re-indentation because a new block was needed to please the borrow checker. I've marked with comments where things actually changed. At this point only mentioned users can see private comments, even when posted as "follower only" or equivalent. What should we do when someone isn't allowed to see a comment? Hide the whole thread, or just the comment? If hiding just the comment, should we mark there is a comment one can't see, but answers they can, or put other comments like if they answered to the same comment the hidden one do?
9 lines
346 B
SQL
9 lines
346 B
SQL
-- Your SQL goes here
|
|
ALTER TABLE comments ADD public_visibility BOOLEAN NOT NULL DEFAULT 't';
|
|
|
|
CREATE TABLE comment_seers (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
comment_id INTEGER REFERENCES comments(id) ON DELETE CASCADE NOT NULL,
|
|
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
|
UNIQUE (comment_id, user_id)
|
|
)
|