I have a session logged into an ejabberd server that is a member of a chatroom.
I log in a second time with the same user/resource.
It seems that if a second session connects, the first session should be terminated, thus, an unavailable presence should be sent out to other chatroom members and then the second session is notified of success.
However, let's say that the first session's client is no longer listening. It's gotten itself into some kind of problem where the session is broken at its end. I've seen cases where the log prints the "Replaced session for" message up to 20 minutes after the second session has been opened and acknowledged. I assume that this is because of some kind of timeout and that the message is being sent asynchronously.
The consequence of this is that my second session joins the chatroom and subsequently gets logged back out because an unavailable presence is sent to the chatroom for the now terminated first session...
Does this seem right? Is it possible? Have I described the scenario correctly?
It seems to me that the correct way to do this would be for the unavailable presence to be sent out only if there is no session for that user signed into the chatroom at that time.