Yesterday I was chatting ay mo office.
I came back home without leaving my session, then when , I had to ask a friend to kick me in order to log back, but I was still unable to log with my nick, as it was still "used"
I figured out that a kicked user has not realy left the chat until he had clicked "ok" on the alert box.
Maybe you should execute the "leave" command before showing the alert ?
Excuse my english, I'm french !
Regards