Perhaps so, but not as friendly as actually having sex with a minor. This issue is at the same time significant (because of what could have followed) and trivial (because of what actually happened). If Hastert was told of improper email messages, the most he should have done is to tell Foley to stop. If the messages were unlawful, there are other avenues for pursuing it.
I've seen adults flirt with kids of the opposite sex. It is creepy, but I don't think it is unlawful. Am I correct in saying that Foley did not have sex with a minor? Is there anything illegal about the messages he sent?
As I wrote earlier, the "legal expert" on CNN said, "yes" he can go to jail for what he supposedly did.
But personally I don't know much about all that.