theahura / shoot-the-messenger

Script to auto-unsend all messages from a facebook messenger chat
Other
184 stars 27 forks source link

Solution for only deleting messages, not unsending #93

Closed a-maxime closed 1 year ago

a-maxime commented 1 year ago

Hi, I'd like to delete some new messages but keep the old ones from specific threads. I might have understood how the program works. Would you confirm it to me ?

In main.js, replacing const unsendButton = document.querySelectorAll(REMOVE_CONFIRMATION_QUERY,)[0]; by const unsendButton = document.querySelectorAll(REMOVE_CONFIRMATION_QUERY,)[1];

Other question : how would I be able to delete the other person messages too ? As I said I just wand to delete those messages on my side, not on the other person side.

Thanks, Max

theahura commented 1 year ago

The code change you're proposing would 'delete' the message, in the sense that it would press the 'delete' button when you open the message modal.

BUT, critically, delete button does not actually delete the message from the person you sent the message to. Unsending a message will hide the message from both you AND the receiver.

If you just want to delete your messages on your side, making the code change you suggested in this issue should work fine. You can also just delete the entire thread by deleting the entire conversation (more on this here: https://www.facebook.com/help/messenger-app/242107552657620). To delete both your message and the person who sent it to you, you're going to need to update this bit of code: https://github.com/theahura/shoot-the-messenger/blob/main/main.js#L122

  const elementsToUnsend = [...document.querySelectorAll(MY_ROW_QUERY)];

to

  const elementsToUnsend = [...document.querySelectorAll(PARTNER_CHAT_QUERY)];
a-maxime commented 1 year ago

Hi @theahura,

Thanks for the answer, my main goal was to deleted messages but not un send those. So the people on the conversation with who I’m chatting isn’t aware of this.

I could delete all the threads in question but I’d rather keep some old messages from those threads/conversations. I was thinking of rate limiting the number of deletions so I could deleted the last 10/100/1000 messages for example ;)