v0.3.4: Comment edit/delete, native notifications, forward-compatible protocol, UI fixes
Comment edit & delete: - EditComment/DeleteComment BlobHeaderDiffOps with upstream+downstream propagation - Trust-based: comment author can edit/delete, post author can delete - Storage: edit_comment(), delete_comment() methods - Frontend: inline edit (Enter/Escape), delete with confirm Native notifications: - tauri-plugin-notification for system notifications on all platforms - Triggers for messages, new posts, reactions, and comments - notif_reacts setting added, button-group toggles replace dropdowns - _notifReady flag prevents startup spam Protocol hardening: - BlobHeaderDiffOp::Unknown variant with #[serde(other)] for forward compatibility - Old nodes silently skip unknown ops instead of crashing UI fixes: - Self removed from Following list - Offline follows in lightbox popup (auto-show if no one online) - Sent DMs filtered from My Posts - Comment threading scoped to closest .post (fixes duplicate ID issue) - Select dropdown text legible in WebKitGTK (black on white options) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ce176a2299
commit
0abc244ee9
18 changed files with 1616 additions and 67 deletions
|
|
@ -5493,6 +5493,18 @@ impl ConnectionManager {
|
|||
}
|
||||
let _ = storage.store_comment(comment);
|
||||
}
|
||||
BlobHeaderDiffOp::EditComment { author, post_id, timestamp_ms, new_content } => {
|
||||
// Trust-based: only the comment author can edit
|
||||
if *author == sender || sender == payload.author {
|
||||
let _ = storage.edit_comment(author, post_id, *timestamp_ms, new_content);
|
||||
}
|
||||
}
|
||||
BlobHeaderDiffOp::DeleteComment { author, post_id, timestamp_ms } => {
|
||||
// Trust-based: comment author or post author can delete
|
||||
if *author == sender || sender == payload.author {
|
||||
let _ = storage.delete_comment(author, post_id, *timestamp_ms);
|
||||
}
|
||||
}
|
||||
BlobHeaderDiffOp::SetPolicy(new_policy) => {
|
||||
if sender == payload.author {
|
||||
let _ = storage.set_comment_policy(&payload.post_id, new_policy);
|
||||
|
|
@ -5504,6 +5516,7 @@ impl ConnectionManager {
|
|||
parent_post_id: payload.post_id,
|
||||
});
|
||||
}
|
||||
BlobHeaderDiffOp::Unknown => {} // future ops — silently skip
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue