Handle available/unavailable presence cycles (fix #32)

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>