[smuxi: 106/111] Engine-IRC: only pass stored networks in invite links (closes: #953)



commit d51099a24ae75f7898991e1d81ae28a39adaa371
Author: Mirco Bauer <meebey meebey net>
Date:   Fri Feb 14 19:34:58 2014 +0100

    Engine-IRC: only pass stored networks in invite links (closes: #953)

 src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs 
b/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
index fa27aa5..c4f2a92 100644
--- a/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
+++ b/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
@@ -262,6 +262,14 @@ namespace Smuxi.Engine
                 host = _IrcClient.Address;
             } else {
                 host = NetworkID;
+                var serverSettings = new ServerListController(Session.UserConfig);
+                var server = serverSettings.GetServerByNetwork(host);
+                if (server == null) {
+                    // if the network is not stored in config, we need to
+                    // fallback to the bare server address. Otherwise the
+                    // frontend will have no idea how to connect to it.
+                    host = _IrcClient.Address;
+                }
             }
             string url = String.Format("irc://{0}/{1}", host, e.Channel);
             builder.AppendUrl(url, _("Accept invite (join room)"));


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