feat: Implement end-to-end encrypted chat with new API routes, crypto utilities, and UI components.

This commit is contained in:
Christopher
2026-01-27 17:59:08 -08:00
parent 5903022f8a
commit 9ee0cbbb9a
20 changed files with 1715 additions and 1525 deletions
+55 -1
View File
@@ -117,6 +117,7 @@ export const signedAPI = {
mediaIds: string[],
linkPreview: any,
replyToId: string | undefined,
swarmReplyTo: any | undefined,
isNsfw: boolean,
userDid: string,
userHandle: string
@@ -124,7 +125,7 @@ export const signedAPI = {
return signedFetch(
'/api/posts',
'post',
{ content, mediaIds, linkPreview, replyToId, isNsfw },
{ content, mediaIds, linkPreview, replyToId, swarmReplyTo, isNsfw },
userDid,
userHandle
);
@@ -156,4 +157,57 @@ export const signedAPI = {
{ method: 'DELETE' }
);
},
/**
* Delete a post
*/
async deletePost(postId: string, userDid: string, userHandle: string) {
return signedFetch(
`/api/posts/${postId}`,
'delete',
{ postId },
userDid,
userHandle,
{ method: 'DELETE' }
);
},
/**
* Submit a report
*/
async report(targetType: string, targetId: string, reason: string, userDid: string, userHandle: string) {
return signedFetch(
'/api/reports',
'report',
{ targetType, targetId, reason },
userDid,
userHandle
);
},
/**
* Block a user
*/
async blockUser(handle: string, userDid: string, userHandle: string) {
return signedFetch(
`/api/users/${handle}/block`,
'block',
{ handle },
userDid,
userHandle
);
},
/**
* Mute a node
*/
async muteNode(domain: string, userDid: string, userHandle: string) {
return signedFetch(
'/api/settings/muted-nodes',
'mute_node',
{ domain },
userDid,
userHandle
);
},
};