Move receiver closing logic out of xmpp processing

Created by  O01eg  on December 2, 2018
5A5UVGNMHEYI62XUENBEPSRJ7M3MBULYITRDOEYYA5ZDUMFBB6ZQC
Change contents