No, I think Gayan is talking about a similar circuit to the one I posted but using high voltage, high value resistors, rather than capacitors, to couple the mains to the MCU input.
I've just realised that D3 an possibly the other diodes aren't needed with my design because they're built into the MCU.
Don't worry about using capacitors to couple the mains as long as they're low value and Y1 rated, they're perfectly safe as long as there are suitable clearances between the mains tracks and MCU side.
If you go for the resistor option, the resistors should be able to withstand a 8kV spike without breaking down and turning into a low resistance, select high voltage resistors and look at the datasheet for the withstand voltage - ask the manufacturer if you're not sure.