fix regression in presence handling
fix regression to session reestablishment

fixes issue #1929
Merge pull request #279 from devrandom/presence

Fix regression in presence handling