hide metadata of private notes #14

Manually merged
Johann150 merged 9 commits from private-notes into main 2022-07-25 16:18:55 +00:00

9 commits

Author SHA1 Message Date
Johann150 3fe351df6d
fix: catch errors from packing with detail
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
Packing with detail can cause an error if the reply or renote
are not visible to the user, even though the original note is
visible to the user.
2022-07-23 22:28:41 +02:00
Johann150 b630cd7eac
refactor: add NoteReactions.packMany 2022-07-23 22:28:40 +02:00
Johann150 6775028b1e
adjust tests 2022-07-23 22:28:40 +02:00
Johann150 128d0f0d4e
remove isHidden and its uses
The `isHidden` attribute is not being set any more and is thus removed.
Handling in the client is no longer necessary.
2022-07-23 22:28:39 +02:00
Johann150 cfa371b52b
refactor: remove note re-packing in streaming API
Instead of packing the note for public user before passing it to
streams, the note is now either packed for the user the respective
stream belongs to (`mainStream`) or not packed at all and then packed
later (`notesStream`).

Because this is a new common task between different channels, a shared
implementation of packing a note from notesStream is created. This
implementation will simply skip a note if it is not visible to the user
that the channel belongs to.
2022-07-23 22:27:29 +02:00
Johann150 c6192ac95a
fix: handle exception in note favorites 2022-07-23 22:27:29 +02:00
Johann150 2486eff747
packing notes not visible to user raises an error
Instead of just hiding specific fields, the entire note is hidden. This means
that metadata of the note such as who is the author, when was it sent are
completely hidden.
2022-07-23 22:27:29 +02:00
Johann150 3c6d9cc8ab
use getNote instead of Notes.find
If a note is not visible to the requesting user, an error will be raised.
2022-07-23 22:27:28 +02:00
Johann150 97edaca351
getNote checks visibility
Raise an error When a note is not visible to the requesting user.
2022-07-23 22:27:14 +02:00