Phoenix presence_diff workings

I have been trying to figure this out but for the life of me I cannot.

What code is responsible for the path of presence_diff in a PubSub/Channel? I had a use case where I want presence but not in JS. I ended up intercepting presence_diff and defining my own handle_out/3.

Even though this works, I cannot seem to find how it actually helps. It seems like some metaprogramming at work, but I can’t put my finger on it.

Any code to point at?