Deleting private conversations / direct messages

Saphira

Member
Is there an existing add-on to delete direct messages/private conversations by user? For when someone leaves your forum. It should delete the entire conversation, not just their part, as "halve conversations" are weird, and if any pictures are in that conversation (or videos or whatever), if they're not external links but onto the file system, those files should be removed also.
 
Have you tried going to the user in the admin panel and selecting the dropdown?

delete conversations.webp

If that's not enough, maybe this addon because it has a delete option:

 
Thank you, that solves part of the problem, it deletes conversations started by him but not those in which he was involved but not starter. :)
 
I was going to suggest a bit of SQL as a solution but then realised that "Conversations" can have multiple parties and so deleting all the messages in a conversation would not just cover those to/from a particular individual but between all parties.

Also, might be a bit dodgy deleting data created by someone other than the target user

It is simple to delete all outbound messages from a user and it is relatively simple to create a list of conversations the user has been party too
 
Well just to leaving my thinking here in case it helps.

SELECT xf_conversation_message.username, xf_conversation_message.message FROM xf_conversation_message
JOIN xf_conversation_user ON xf_conversation_message.conversation_id = xf_conversation_user.conversation_id
WHERE xf_conversation_user.owner_user_id = 'xxx';

This should list all messages to/from the user (I think!!!!)
 
Thank you, that solves part of the problem, it deletes conversations started by him but not those in which he was involved but not starter. :)
Wow really ? To be fair for most situations yo do that to a spammer and it works pretty good. I think it should be renamed Delete Conversations started by user but thats too long for a title maybe.
 
It depends on the type of forum you have, I suppose. Mine is of a nature where most people value their privacy. I wouldn't want anyone at any later date to read someone's conversations, after that person had left the site. If I would leave a site like it, I would want mine to be deleted also. I'm just being protective over my community. :)

Anyway, for future reference, these are the steps:
1) Obtain user_id value from the xf_user table.
2) Based on that user_id, obtain a list of conversation_id from table xf_conversation_message
3) Delete from xf_conversation_message, xf_conversation_master, xf_conversation_user and xf_conversation_recipient where conversation_id in the list you found.

I'm not sure how it would work if any of those contained attachments - that seemed to be not applicable in this case.
 
Back
Top Bottom