import java.util.EnumSet;
import java.util.Set;
+import javax.net.ssl.SSLException;
+
import org.eclipse.jdt.annotation.Nullable;
import ro.ieval.fonbot.Address.Protocol;
runnable.doRun();
} catch (final SocketTimeoutException e){
Log.d("LongPollRunnable", "Socket timeout, refreshing connection");
+ } catch (final SSLException e){
+ Log.d("LongPollRunnable", "Got SSLException, refreshing connection");
} catch (final Exception ex){
ex.printStackTrace();
break;
Utils.processCommand(this, toNonNull(words[0]), args, toNonNull(address));
}
- if(longPollThread == null || !longPollThread.isAlive()){
+ final String user=PreferenceManager.getDefaultSharedPreferences(this).getString("username", null);
+ final String password=PreferenceManager.getDefaultSharedPreferences(this).getString("password", null);
+ final boolean has_user_pass = user != null && password != null && user.length() > 0 && password.length() > 0;
+ if((longPollThread == null || !longPollThread.isAlive()) && has_user_pass){
longPollThread = new Thread(new LongPollRunnable());
longPollThread.start();
}