feat(instagram): save deleted messages - #1531
Conversation
Captures incoming DMs locally as they arrive so they stay readable after the sender unsends them. Adds a history button on the DM action bar and a viewer activity listing per-chat (or all) deleted messages, with per-sender attribution. Media is recovered too: photos, videos, media/raven/clip/reel shares and voice notes resolve their CDN url at patch time via the DirectItem entity; xma reshares recover the post/reel permalink and open in Instagram. Tapping a saved item offers open/download/copy, reusing the existing download feature. Gated behind a 'Save deleted messages' toggle under DM settings.
|
Thanks for the new PR. is it WIP or ready to ship? |
|
Not WIP, it's ready — can push fixes later if anything comes up. It closes #1073 |
| /** First String field on {@code o} whose value is an instagram.com post/reel permalink, query stripped. */ | ||
| private String firstInstagramPermalink(Object o) { | ||
| try { | ||
| for (java.lang.reflect.Field g : o.getClass().getDeclaredFields()) { |
There was a problem hiding this comment.
Avoid finding fields and methods on runtime
There was a problem hiding this comment.
same fix here , this is still inside xmaReshareLink() so it uses the same patch time resolved names..
no runtime field hunting. the instagram.com check is just filtering out non-post xma links (like xma_link)
updated in the last commit
There was a problem hiding this comment.
Sorry I still don't get it, why do we required to find the element everytime on runtime
…it deleted-messages resource patch
|
I finally got time to test it patch. First of all the patch works amazing. I havent dig deep into the code. I just got 2 suggestions.
The UI could be more intuitive, but ya, we can discuss or handle it as a future PR. Thanks for this PR 💌 |
…om settings Drop the hard portrait lock on the deleted-messages screen in favour of SCREEN_ORIENTATION_USER so tablets/landscape stay usable while still honouring a user's rotation lock. Open the settings entry point unscoped so it always lists all chats instead of inheriting the last-opened thread.
|
Is username something that can be achieved? |
Hey , We get the username separately: a small directory (sender_id → username) that's filled from the thread's participant list via noteThreadUsers(). That hook only runs when the participant list loads/refreshes for a thread — it writes the name once and doesn't refresh after. So if a sender's first message lands before that list loads, the row keeps the raw id; and it won't follow later username changes. That's why it can look like it only worked the first time. |
I'm pretty sure they would expect user names. Also does it capture all the messages or only those that are deleted? Either way we may need to add delete data to clear media cache as well as db |
there's no separate media cache to clear — media isn't downloaded, we only store the CDN/permalink URL as the row content. Clearing the DB row is clearing the media reference tooo |
I got users ids on a existing chat ( 1on1 chat not a group)
My bad I haven't explored it much |
|
@vishnuprasad0 Will it also work for Disappearing Messages or not. Like if someone in chat enables the disappearing messages after 24hr. I think it should be merged with it. Bcoz both works in the same way. |
|
Hey, can you test the PR on 439 ? |
Saves incoming DMs as they arrive so you can still read them after they're unsent.
Adds a button on the DM header to view a chat's deleted messages (or all of them). Works for text and media — photos, videos, shared posts/reels and voice notes. Tapping a saved message lets you open, download or copy it.
Toggle it under DM settings.