XF/Repository/Conversation.php
public function getValidatedRecipients
But I think there will be other stumbling blocks besides just that function. I don't recall what they were at this point. If something blows up, you found it!
Yeah, it is hitched up somewhere else as well. Removing the check in that file then results in the error message being, "Please enter at least one valid recipient."
Those code I am changing is only part of the function, there is other code in the functions. So I am only looking to change what is needed. So I don't think I am replacing stock functions?
There is a very fine line when working with stock functions, changing code in them and if it's acceptable or not.
The intent of the add-on has to be taken into consideration. In most cases you will want to return a modified version of the parent function results, or return control back to the parent when your modification is complete. BUT, in this case if you return control back to the parent you'll end up back in the same boat you started in and the original errors will be thrown. Or if you gather the original results for modification, I think the original errors will be thrown before you get them.
Keep in mind if you don't return control to the parent that other add-ons that might be extending the function may not run. And, while the intent of the add-on is to allow you to send a PC to yourself, other add-ons may not function properly if that is allowed.
It's another one of those sticky situations where I don't feel comfortable making the final call. But I'm going to guess this wouldn't be allowed. (could be wrong)
I haven't looked at the code, but have a look at the creator's setRecipients function (and maybe other places too). The answer might be there if you can unset the error.
Underlying all of this is, why the hell doesn't xF want people sending private messages to themselves? Most all forum software I have used or owned, allows this. I'm curious to know what the problem with it is, for xF.
Lots of people do that to send notes to themselves, or images they want to keep and use in a thread. I use it to send images from my phone in private, but with xF I had to do a workaround and create an alternate handle just for the purpose.
I've seen other folks ask about this here, but never seen an answer.
It's another one of those sticky situations where I don't feel comfortable making the final call. But I'm going to guess this wouldn't be allowed. (could be wrong)
You could check what errors are added, and then check to see if one of the errors is the one for starting a conversation with yourself (the 'please_enter_at_least_one_valid_recipient' phrase). If so, remove it.
If you fail to return control to parent you're generally going to cause incompatibilities at some point with some add-on, so usually always a bad idea.