Use domain instead of IP for default server.

This commit is contained in:
Felix Ableitner 2016-03-07 14:26:44 +01:00
parent ca2c4c65ab
commit 127acfb3ab
4 changed files with 8 additions and 3 deletions

View File

@ -74,7 +74,7 @@ class FirstStartActivity extends AppCompatActivity with OnEditorActionListener w
.putBoolean(KeyNotificationSoundsOn, DefaultNotificationSoundsOn)
.putString(KeyScanInterval, DefaultScanInterval.toString)
.putString(KeyMaxConnections, DefaultMaxConnections.toString)
.putString(KeyServers, DefaultServers.mkString(", "))
.putString(KeyServers, DefaultServers)
.apply()
startMainActivity()

View File

@ -25,7 +25,8 @@ object SettingsInterface {
val DefaultScanInterval = 15
val DefaultNotificationSoundsOn = true
val DefaultMaxConnections = 1000000
val DefaultServers = Set("46.101.249.188:26344", "46.101.238.107:26344")
// When updating this, be sure to adjust the code in [[InternetInterface.create]].
val DefaultServers = Set("ensichat.nutomic.com:26344").mkString(", ")
}

View File

@ -39,6 +39,10 @@ class InternetInterface(connectionHandler: ConnectionHandler, crypto: Crypto,
* Initializes and starts discovery and listening.
*/
override def create(): Unit = {
val servers = settings.get(SettingsInterface.KeyServers, "")
.replace("46.101.249.188:26344", SettingsInterface.DefaultServers)
settings.put(SettingsInterface.KeyServers, servers)
FutureHelper {
serverThread.start()
openAllConnections(maxConnections)

View File

@ -38,7 +38,7 @@ object Main extends App with CallbackInterface {
KeyFolder.mkdirs()
Log.setLogInstance(logInstance)
sys.addShutdownHook(connectionHandler.stop())
settings.put(KeyServers, DefaultServers.mkString(", "))
settings.put(KeyServers, DefaultServers)
val parser = new OptionParser[Config]("ensichat") {
head("ensichat")