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>
Wed, 4 Apr 2018 21:14:04 +0000 (23:14 +0200)
commit5227b50665053aaf6777837ed1a4390129f4b98e
tree96e9c212a7fa7eefbb06177604225f95699c56b3
parent720ea13ed59615e5ce5d31badf3ff897128d69b2
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

(cherry picked from commit cb53823eeecff3f033adfe2cb1a48d8b8a89dbae)
src/core/corenetwork.cpp