updated chat snippets, added example for relogin in chat on wifi state changed