feat(dm): delete message for everyone via NIP-09 kind 5 events#2394
Merged
NotThatKindOfDrLiz merged 2 commits intomainfrom Mar 24, 2026
Merged
feat(dm): delete message for everyone via NIP-09 kind 5 events#2394NotThatKindOfDrLiz merged 2 commits intomainfrom
NotThatKindOfDrLiz merged 2 commits intomainfrom
Conversation
Implement "Delete for everyone" in DM conversations using NIP-09 kind 5 deletion events. Both sender and receiver process the kind 5 client-side — relay deletion is not relied upon. Data layer: - Add `is_deleted` boolean column to `direct_messages` table - Soft-delete preserves `gift_wrap_id` for dedup on relay re-delivery - `watchMessages` / `getMessages` exclude deleted rows - Add `markMessageDeleted` and `getMessageById` to DAO - Add column migration in `_createMissingTables` Repository layer: - `deleteMessageForEveryone`: validates sender, publishes kind 5 with `p` tags for relay delivery, soft-deletes locally, refreshes conversation preview - `_handleDeletionEvent`: processes incoming kind 5 events with NIP-09 sender validation before applying soft-delete - Subscription and poll filters now include `EventKind.eventDeletion` BLoC layer: - Add `ConversationMessageDeleted` event with `droppable()` transformer - Handler delegates to repository; UI updates via reactive stream Presentation layer: - Add `MessageActionsSheet` with Copy, Delete (sent), Report (received) - Add `onLongPress` callback to `MessageBubble` - Wire long-press handler in conversation view Closes #2388
Mobile PR Preview
|
Member
|
It looks like #2389 has been merged. @realmeylisdev: Is this ready to go? If so, can you please rebase and mark it as ready for review so that @untreu2 and @omartinma can take a look? Thanks! |
…eryone # Conflicts: # mobile/lib/screens/inbox/conversation/conversation_view.dart # mobile/lib/screens/inbox/conversation/widgets/message_bubble.dart
untreu2
approved these changes
Mar 24, 2026
hm21
pushed a commit
that referenced
this pull request
Mar 24, 2026
Implement "Delete for everyone" in DM conversations using NIP-09 kind 5 deletion events. Both sender and receiver process the kind 5 client-side — relay deletion is not relied upon. Data layer: - Add `is_deleted` boolean column to `direct_messages` table - Soft-delete preserves `gift_wrap_id` for dedup on relay re-delivery - `watchMessages` / `getMessages` exclude deleted rows - Add `markMessageDeleted` and `getMessageById` to DAO - Add column migration in `_createMissingTables` Repository layer: - `deleteMessageForEveryone`: validates sender, publishes kind 5 with `p` tags for relay delivery, soft-deletes locally, refreshes conversation preview - `_handleDeletionEvent`: processes incoming kind 5 events with NIP-09 sender validation before applying soft-delete - Subscription and poll filters now include `EventKind.eventDeletion` BLoC layer: - Add `ConversationMessageDeleted` event with `droppable()` transformer - Handler delegates to repository; UI updates via reactive stream Presentation layer: - Add `MessageActionsSheet` with Copy, Delete (sent), Report (received) - Add `onLongPress` callback to `MessageBubble` - Wire long-press handler in conversation view Closes #2388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2388
Summary
is_deleted = trueinstead of removing the row, sogift_wrap_iddedup continues to reject relay re-deliveryLayers changed
tables.dart,app_database.dart,direct_messages_dao.dartis_deletedcolumn, migration,markMessageDeleted,getMessageById, filtered queriesdm_repository.dartdeleteMessageForEveryone,_handleDeletionEvent,_refreshConversationPreview, updated filtersconversation_bloc.dart,conversation_event.dartConversationMessageDeletedevent withdroppable()transformermessage_actions_sheet.dart,message_bubble.dart,conversation_view.dartonLongPressprop, wiringProtocol notes
ptags for conversation participants so relay#pfilters deliver it to the other partyTest plan