more additions to private posts #154
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: several additions and fixes to private posts
about: Private posts
Summary of Changes
This pull request includes several changes to improve the handling of post text and encryption in the
post-cardcomponent. The most important changes involve adding checks for undefined post text, modifying the decryption function to handle different encryption algorithms and key lengths, and updating theBSkyPosttype definition to include optional fields.Improvements to post text handling:
src/components/post-card.tsx: Added a check to ensure the post text is defined before copying it to the clipboard. If the post text is undefined, a message indicating that private posts cannot be copied is shown instead.Enhancements to decryption process:
src/components/post-card.tsx: Updated thedecryptPrivatePostfunction to use the encryption algorithm and key length specified in the post's encryption metadata, improving the flexibility and security of the decryption process. [1] [2]Updates to type definitions:
src/lib/bluesky/types/bsky-post.ts: Modified theBSkyPosttype to make thetext,akariPublicKey, andencryptedTextfields optional. Additionally, added a nested object for the encryption key withkeyandlengthproperties.License Agreement