From b6fc8f2ef7e7c21281af4cc2bfe82101be9dfc7e Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 4 Jan 2017 13:09:46 +0100 Subject: [PATCH] Getting a little defensive --- Logic/Communications/Payload/ParticipantMailPayload.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Logic/Communications/Payload/ParticipantMailPayload.cs b/Logic/Communications/Payload/ParticipantMailPayload.cs index b1d143a8..cfeec13d 100644 --- a/Logic/Communications/Payload/ParticipantMailPayload.cs +++ b/Logic/Communications/Payload/ParticipantMailPayload.cs @@ -106,9 +106,15 @@ namespace Swarmops.Logic.Communications.Payload } } + if (!subject.StartsWith("[")) + { + // This is a little defensive programming as some subjects start with [Organization] and some don't - fix that here + subject = "[" + Strings[MailPayloadString.OrganizationName] + "] " + subject; + } + RenderedComm result = new RenderedComm(); result[CommRenderPart.BodyText] = body; - result[CommRenderPart.Subject] = "[" + Strings[MailPayloadString.OrganizationName] + "] " + subject; + result[CommRenderPart.Subject] = subject; result[CommRenderPart.SenderMail] = "admin@swarmops.com"; // TODO: FIX FIX FIX HACK result[CommRenderPart.SenderName] = "Swarmops Administrative";