core: connectToIrc: Pick first IRC server specified when not failed
authorgenius3000 <genius3000@g3k.solutions>
Fri, 14 Apr 2017 00:01:36 +0000 (18:01 -0600)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 24 Apr 2017 21:02:16 +0000 (23:02 +0200)
commitcb53823eeecff3f033adfe2cb1a48d8b8a89dbae
tree3e1f7714c184586b6b7a8a84c546cf237b47d6bc
parentdc0c6b90a8d6788d6a14b164c5685ce45b3b0a49
core: connectToIrc: Pick first IRC server specified when not failed

When connecting to the IRC network, only clear the
'_previousConnectionAttemptFailed' flag when trying the next server
in the list. Otherwise, reset server index to start from the top.

Currently, Quassel will continue to use the last used (working)
server (or a random server if set to). This doesn't match the
intention of having an ordered list of servers to use. The change
here just makes Quassel start with the first server in the list
unless it's a failed attempt, in which it continues down the list
(same as currently).

This fixes the issue of getting "stuck" on a specific server even if
you manually disconnect and connect.

Reference: http://bugs.quassel-irc.org/issues/693
And: http://bugs.quassel-irc.org/issues/1006
Fixes #693 and #1006
Resolves GH-287
src/core/corenetwork.cpp