diff --git a/build/Version.props b/build/Version.props index 62ba6fa859..c94784c13d 100644 --- a/build/Version.props +++ b/build/Version.props @@ -5,9 +5,9 @@ 5.2.0 4.4.0 - 9.6.0 - 10.0.0 - 11.0.0 + 9.7.0 + 10.1.0 + 11.1.0 6.0.5 5.3.0 1.2.0 diff --git a/src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs b/src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs index 88ff9b0d47..c51d74a49f 100644 --- a/src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs +++ b/src/Tgstation.Server.Api/Models/DiscordConnectionStringBuilder.cs @@ -24,6 +24,11 @@ namespace Tgstation.Server.Api.Models /// public bool BasedMeme { get; set; } + /// + /// If the tgstation-server logo is shown in deployment embeds. + /// + public bool DeploymentBranding { get; set; } + /// /// The . /// @@ -47,21 +52,25 @@ namespace Tgstation.Server.Api.Models throw new ArgumentNullException(nameof(connectionString)); var splits = connectionString.Split(';'); + BotToken = splits.First(); + if (splits.Length < 2 || !Enum.TryParse(splits[1], out var dMOutputDisplayType)) dMOutputDisplayType = DiscordDMOutputDisplayType.Always; DMOutputDisplay = dMOutputDisplayType; + if (splits.Length > 2 && Int32.TryParse(splits[2], out Int32 basedMeme)) - { BasedMeme = Convert.ToBoolean(basedMeme); - } else - { BasedMeme = true; // oranges said this needs to be true by default :pensive: - } + + if (splits.Length > 3 && Int32.TryParse(splits[3], out Int32 branding)) + DeploymentBranding = Convert.ToBoolean(branding); + else + DeploymentBranding = true; // previous default behaviour } /// - public override string ToString() => $"{BotToken};{(int)DMOutputDisplay};{Convert.ToInt32(BasedMeme)}"; + public override string ToString() => $"{BotToken};{(int)DMOutputDisplay};{Convert.ToInt32(BasedMeme)};{Convert.ToInt32(DeploymentBranding)}"; } } diff --git a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs index 468982d7af..8613aacb86 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs @@ -70,6 +70,11 @@ namespace Tgstation.Server.Host.Components.Chat.Providers /// readonly bool basedMeme; + /// + /// If the tgstation-server logo is shown in deployment embeds. + /// + readonly bool deploymentBranding; + /// /// The . /// @@ -177,6 +182,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers var botToken = csb.BotToken; basedMeme = csb.BasedMeme; outputDisplayType = csb.DMOutputDisplay; + deploymentBranding = csb.DeploymentBranding; serviceProvider = new ServiceCollection() .AddDiscordGateway(serviceProvider => botToken) @@ -282,13 +288,14 @@ namespace Tgstation.Server.Host.Components.Chat.Providers localCommitPushed |= revisionInformation.CommitSha == revisionInformation.OriginCommitSha; var fields = BuildUpdateEmbedFields(revisionInformation, byondVersion, gitHubOwner, gitHubRepo, localCommitPushed); + var author = new EmbedAuthor(assemblyInformationProvider.VersionPrefix) + { + Url = "https://github.com/tgstation/tgstation-server", + IconUrl = "https://avatars0.githubusercontent.com/u/1363778?s=280&v=4", + }; var embed = new Embed { - Author = new EmbedAuthor(assemblyInformationProvider.VersionPrefix) - { - Url = "https://github.com/tgstation/tgstation-server", - IconUrl = "https://avatars0.githubusercontent.com/u/1363778?s=280&v=4", - }, + Author = deploymentBranding ? author : default, Colour = Color.FromArgb(0xF1, 0xC4, 0x0F), Description = "TGS has begun deploying active repository code to production.", Fields = fields,