Only connect to chat upon authenticating
hello! this is my first time contributing to pleroma, so please be aware
something i noticed while using pleroma is that if you are logged out, then cryptic websocket errors get outputted to the console (as outlined in #403 (closed)). (this only happens with pleroma instances that have chat enabled.)
while checking the code, it appears that p-fe makes a connection to the chat channel if chat is enabled, even if we aren't logged in. this patch adds a secondary condition that enforces the existence of a websocket token before attempting to connect to chat. this patch only creates a connection to the chat channel upon authenticating. the websocket token is only set upon verifying credentials, so:
this means that only logged in users are ever able to see chat, but i'm sure that's the intended behavior... right?