bp_get_the_thread_recipients reporting extra names
When looking at the ‘single’ view of a BP message/thread, the line at the top that reports the recipeients, e.g. “Conversation between you and XXXXX” is reporting extra names, which is terrifying our users!
I suspect it has to do with my deleting some spam messages created by a spam user earlier today, using SQL:
DELETE FROM wp_bp_messages_messages WHERE sender_id=’xxxx’ (spam user’s id)
I also deleted from bp_notifications so that the recipeients of spam would no longer have items to read in their inbox.
wp_bp_notificationsWHERE secondary_item_id=’xxxx’ (spam user’s id)
So there’s a big gap in conversation IDs in the database, where conversations were deleted. But subsequent conversations are being ID’d accordingly, i.e. they’re not falling into the gap, they’re auto-indexing higher than the highest conversation ID. This seems normal.
bp_get_the_thread_recipients is always printing the proper sender (saying “You), the proper recipeient, but it’s also reporting “Deleted User” as well as some other user in the system which is always different.
For example, if I “adamt19” send a message to “example user”, the line used to read:
“Conversation between you and example user”
wheras now it says:
“Conversation between you, someotheruser, Deleted user, and example user”
Naturally this is freaking out the true recipient. I’ve double checked that the extra names are NOT actually receiving mail. So that’s good, at least. But why would these other names be returned by bp_get_the_thread_recipients and how do I fix it?
Also, if there’s a better way/missing step in my process for removing spam pls advise!
wp_bp_messages_recipients is where the problem is..
I do see IDs for the other two names in this table. I still don’t think these people are actually receiving the messages, though… still checking
Turns out those other users are in fact receiving messages NOT intended for them. I’ve had to put our production site into Maintenance mode until this is sorted out. Any emergency help/notes/advice would be greatly appreciated!
What I think I’ve learned:
wp_bp_messages_recipients needed some work before spam content was safely deleted
not paying attention to wp_bp_messages_recipients, and simply deleting data from wp_bp_messages_messages and wp_bp_notifications …meant that when bp_get_the_thread_recipients is called, subsequent conversation IDs got confused with data left over in wp_bp_message_recipients, and additional recipients were pulled into the conversation.
This was pretty much the worst possible thing that could happen on a social network (especially a dating site) so, hopefully these notes help someone else. This occurred as a result of my deleting message spam (in an incomplete manner) so hopefully there are some qualified plugins for spam prevention and message moderation that I simply haven’t stumbled upon yet.
- The topic ‘bp_get_the_thread_recipients reporting extra names’ is closed to new replies.