[polari/gnome-3-20] application: Consider port for alternate server list



commit 759e146a2d20a8e67c4b2f083326dfdaaf8e4ba8
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Sep 9 02:23:08 2016 +0200

    application: Consider port for alternate server list
    
    When we fail to connect to a network with multiple servers, we build
    a list of alternate servers for retrying, excluding the original
    server that already failed. Currently that filtering is based solely
    on the server address, in the assumption that servers would not just
    differ by port - however that's exactly the case for FreeNode, so
    to not effectively disable connection retries there, we need to take
    the port number into account as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771217

 src/application.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 4cc2db6..03b278b 100644
--- a/src/application.js
+++ b/src/application.js
@@ -375,8 +375,10 @@ const Application = new Lang.Class({
 
         let roomId = Polari.create_room_id(account,  targetId, targetType);
 
-        let params = account.dup_parameters_vardict().deep_unpack();
-        let server = params['server'].deep_unpack();
+        let params = Connections.getAccountParams(account);
+        let server = params['server'];
+        let port = params['port'];
+
         let accountServers = [];
 
         // If predefined network, get alternate servers list
@@ -393,7 +395,8 @@ const Application = new Lang.Class({
           retry: 0,
           originalNick: account.nickname,
           callback: callback,
-          alternateServers: accountServers.filter(s => s.address != server)
+          alternateServers: accountServers.filter(s => s.address != server ||
+                                                       s.port != port)
         };
 
         this._pendingRequests[roomId] = requestData;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]