-
Notifications
You must be signed in to change notification settings - Fork 303
Allow users to delete messages only for themselves (Delete message for me
- feature)
#5967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DB Entities have been updated. Do we need to upgrade DB Version?
|
SDK Size Comparison 📏
|
286f863
to
c74fd57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the "Delete message for me" feature, allowing users to delete messages only from their own view while keeping them visible to other users. The feature adds a new deletedForMe
field to the Message model and corresponding database entity, along with API support for the delete-for-me operation.
Key changes include:
- Added
deletedForMe
Boolean field to the Message model and database entity - Implemented API endpoint for delete-for-me functionality with new query parameter
- Updated UI components to handle and display delete-for-me state
- Added sample implementation with custom component factory
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Message.kt | Added deletedForMe field to core Message model |
MessageEntity.kt | Added deletedForMe field to database entity |
MessageMapper.kt | Updated mapping between entity and domain model |
ChatDatabase.kt | Incremented database version for schema change |
MessageApi.kt | Added deleteForMe query parameter to delete endpoint |
ChatClient.kt | Added deleteMessageForMe method |
DeleteMessageForMeComponentFactory.kt | Sample UI component for delete-for-me functionality |
Various test files | Updated tests to support new delete-for-me parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../io/getstream/chat/android/compose/sample/ui/component/DeleteMessageForMeComponentFactory.kt
Outdated
Show resolved
Hide resolved
.../io/getstream/chat/android/compose/sample/ui/component/DeleteMessageForMeComponentFactory.kt
Show resolved
Hide resolved
fc493df
to
4005f7c
Compare
e04af76
to
ecda885
Compare
Delete message for me
- feature)
…n status for the current user
… message deletion in XML SDK
035bc43
to
5aff87d
Compare
5aff87d
to
7104e52
Compare
|
🎯 Goal
Introduce the "Delete message for me" feature to the LLC, allowing users to delete messages only from their own view while keeping them visible to other users.
🛠 Implementation details
deletedForMe
field to theMessage
model, corresponding database entity, andMessageDeletedEvent
, along with introducingChatClient.deleteMessageForMe
function.🎨 UI Changes
Note
Demo apps only. No UI is included in the SDK for this feature.
Screen.Recording.2025-10-16.at.16.38.03.mov
Screen.Recording.2025-10-16.at.16.35.50.mov
🧪 Testing
Using both XML and Compose demo apps:
For different visibilities when a message is deleted, you can change
deletedMessageVisibility
:DeletedMessageVisibility.ALWAYS_VISIBLE
:DeletedMessageVisibility.ALWAYS_HIDDEN
:DeletedMessageVisibility.VISIBLE_FOR_CURRENT_USER
:Changing
deletedMessageVisibility
:Compose
Update
MessagesActivity.factory
to change thedeletedMessageVisibility
XML
Update
ChatFragment.initMessageListViewModel
tosetDeletedMessageVisibility
Important
Test in both online and offline modes