You actually get them to use it? That's the problem with most of these ideas: sure, you can just roll your own encryption, chat program, etc., but getting the people in your life to use it is another matter. My mom has enough trouble using the popular and ubiquitous chat app we communicate through; something custom is going to be beyond her.
Going custom is beyond the majority of people, of course pedophiles will still be able to avoid being spied on, while the everyday Joe won't spend time to. I even doubt everyday Joe will know about this
At the end, it could be a OS-based scanning, so no matter if the message is encrypted in transit, or self-hosted, then if the message is displayed it could be transmitted and scanned.
That will never fly in every Linux distribution (if any at all), so there’s never going to be a way to stop this for even reasonably proficient criminals.