Improvements to presence stanza detection