What happens to Alliances when a player goes AFK/Quits?

Kinda curious what happens to an alliance when a player goes AFK/Quits?

I.e. when you have an alliance, you can see what their Scan can see and if you “attack” one of their stars, your ships becomes theirs. So when they go AFK, are both of those negated right away, in 24 hours, or do you still need to declare war? And is it the same if they quit?

I believe all alliances are canceled without the normal 24h grace period.