IRC nickname defaults to instance name. Constified NEEDS INITIALIZING

This commit is contained in:
Cyberboss
2017-11-01 13:38:54 -04:00
parent ad6bb645a0
commit 755d537a99
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ namespace TGServerService
public string CommitterName { get; set; } = "tgstation-server";
public string CommitterEmail { get; set; } = "tgstation-server@tgstation13.org";
public string ChatProviderData { get; set; } = "NEEDS INITIALIZING";
public string ChatProviderData { get; set; } = ServerInstance.UninitializedString;
public string ChatProviderEntropy { get; set; }
public bool ReattachRequired { get; set; } = false;
+8 -3
View File
@@ -10,6 +10,11 @@ namespace TGServerService
{
sealed partial class ServerInstance : ITGChat
{
/// <summary>
/// Used for indicating unintialized encrypted data
/// </summary>
public const string UninitializedString = "NEEDS INITIALIZING";
/// <summary>
/// List of <see cref="IChatProvider"/>s for the <see cref="ServerInstance"/>
/// </summary>
@@ -130,8 +135,8 @@ namespace TGServerService
lock (ChatLock)
{
var rawdata = Config.ChatProviderData;
if (rawdata == "NEEDS INITIALIZING")
return new List<ChatSetupInfo>() { new IRCSetupInfo(), new DiscordSetupInfo() };
if (rawdata == UninitializedString)
return new List<ChatSetupInfo>() { new IRCSetupInfo() { Nickname = Config.Name }, new DiscordSetupInfo() };
string plaintext;
try
@@ -159,7 +164,7 @@ namespace TGServerService
}
catch
{
Config.ChatProviderData = "NEEDS INITIALIZING";
Config.ChatProviderData = UninitializedString;
}
}
//if we get here we want to retry