adapt sample for xmpp