Before merging, maybe other people using presence modules, like @phil-lavin or @lazedo, can have a look and comment if they find something inconsistent here, because I don't have the time right now to go in deeper review and analysis of the code for side effects.