OUT-452: Change mail text
authorThomas
Fri, 18 May 2018 09:28:27 +0200
changeset 220227584ccea6f4
parent 2201 5c9f9d4ec13f
child 2203 eb3db8f1ec68
OUT-452: Change mail text
FPPMessage.cs
UI/FormControlPreviewMessage.xaml.cs
     1.1 --- a/FPPMessage.cs	Thu May 17 15:41:18 2018 +0200
     1.2 +++ b/FPPMessage.cs	Fri May 18 09:28:27 2018 +0200
     1.3 @@ -20,13 +20,24 @@
     1.4      {       
     1.5          public const string PEP_FPP_MESSAGE_BODY_PLAIN                  = "This message is protected by p≡p. \n\nTo read this message, you can either download the free p≡p Reader here: " +
     1.6                                                                            Globals.PEP_WEBSITE_READER_LINK + " \n\nTo read and send protected messages yourself, you can get your copy of p≡p here: " +
     1.7 -                                                                          Globals.PEP_WEBSITE_UPGRADE_LINK;
     1.8 +                                                                          Globals.PEP_WEBSITE_UPGRADE_LINK +
     1.9 +                                                                          "\n\nThis message can only be opened with p≡p for Outlook or p≡p Reader for Outlook.";
    1.10          public const string PEP_FPP_MESSAGE_BODY_HTML                   = "This message is protected by <a style=\"color:#03AA4B; text-decoration: none\" href=\"" + Globals.PEP_WEBSITE_LINK + "\">p≡p</a>. <br><br>To read this message, you can either download the free " +
    1.11                                                                            "<a style=\"color:#03AA4B; text-decoration: none\" href=\"" + Globals.PEP_WEBSITE_READER_LINK + "\">p≡p Reader</a> or, " +
    1.12                                                                            "to read and send protected messages yourself, you can get your copy of <a style=\"color:#03AA4B; text-decoration: none\" href=\"" +
    1.13 -                                                                          Globals.PEP_WEBSITE_UPGRADE_LINK + "\">p≡p here</a>.";
    1.14 -        public const string PEP_FPP_MESSAGE_BODY_PLAIN_PEP_INSTALLED    = "This message is protected by p≡p. \n\nTo read this message please click the Privacy Status button and follow the instructions.";
    1.15 -        public const string PEP_FPP_MESSAGE_BODY_HTML_PEP_INSTALLED     = "This message is protected by <a style=\"color:#03AA4B; text-decoration: none\" href=\"" + Globals.PEP_WEBSITE_LINK + "\">p≡p</a>. <br><br>To read this message please click the Privacy Status button and follow the instructions.";
    1.16 +                                                                          Globals.PEP_WEBSITE_UPGRADE_LINK + "\">p≡p here</a>." +
    1.17 +                                                                          "<br><br>This message can only be opened with p≡p for Outlook or p≡p Reader for Outlook.";
    1.18 +        public const string PEP_FPP_MESSAGE_BODY_PLAIN_PEP_INSTALLED    = "This message is protected by p≡p. \n\nTo read this message please do the following:" +
    1.19 +                                                                          "\n\n1. Click the Privacy Status button on the bottom of this message to open the Handshake dialog." +
    1.20 +                                                                          "\n2. Shortly after you opened the Handshake dialog on your computer, the same dialog will show up on the screen of the sender of the message as well(depending on the setup it might take 2-3 minutes). Contact the sender through another communication channel(e.g.phone call)." +
    1.21 +                                                                          "\n3. Compare the Trustwords with your communication partner. If the Trustwords match, confirm the Trustwords by clicking the green button." +
    1.22 +                                                                          "\n4. Shortly after, the protected message will automatically decrypt and you can read the message.";
    1.23 +        public const string PEP_FPP_MESSAGE_BODY_HTML_PEP_INSTALLED     = "<!DOCTYPE html><html><head><meta http-equiv='Content-Type' content='text/html;charset=UTF-8'></head><body>" +
    1.24 +                                                                          "This message is protected by <a style=\"color:#03AA4B; text-decoration: none\" href=\"" + Globals.PEP_WEBSITE_LINK + "\">p≡p</a>. <br><br>To read this message please do the following:" +
    1.25 +                                                                          "<br><br>1. Click the Privacy Status button on the bottom of this message to open the Handshake dialog." +
    1.26 +                                                                          "<br>2. Shortly after you opened the Handshake dialog on your computer, the same dialog will show up on the screen of the sender of the message as well(depending on the setup it might take 2-3 minutes). Contact the sender through another communication channel(e.g.phone call)." +
    1.27 +                                                                          "<br>3. Compare the Trustwords with your communication partner. If the Trustwords match, confirm the Trustwords by clicking the green button." +
    1.28 +                                                                          "<br>4. Shortly after, the protected message will automatically decrypt and you can read the message.</body></html>";
    1.29          public const string PEP_FPP_ATTACHMENT_FILE_NAME                = "ignore_this_attachment.pEp";
    1.30          public const string PEP_FPP_ATTACHMENT_MIME_TYPE                = "application/pEp.forceProtected";
    1.31  
    1.32 @@ -211,6 +222,12 @@
    1.33                  else
    1.34                  {
    1.35                      Log.Error("FPPMessage.ProcessIncoming: Task result is failure.");
    1.36 +
    1.37 +                    // Decrement decryption counter if necessary
    1.38 +                    if (manuallyTriggered == false)
    1.39 +                    {
    1.40 +                        ThisAddIn.DecryptionStack.DecrementDecryptionCounter();
    1.41 +                    }
    1.42                  }
    1.43              }, TaskScheduler.FromCurrentSynchronizationContext());
    1.44  
     2.1 --- a/UI/FormControlPreviewMessage.xaml.cs	Thu May 17 15:41:18 2018 +0200
     2.2 +++ b/UI/FormControlPreviewMessage.xaml.cs	Fri May 18 09:28:27 2018 +0200
     2.3 @@ -178,7 +178,14 @@
     2.4                      {
     2.5                          Regex r = new Regex("<head(.*?)>", RegexOptions.IgnoreCase);
     2.6                          Match m2 = r.Match(htmlString);
     2.7 -                        htmlString = r.Replace(htmlString, m2.Value + "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>", 1);
     2.8 +                        if (string.IsNullOrEmpty(m2.Value))
     2.9 +                        {
    2.10 +                            htmlString = "<head><meta http-equiv='Content-Type' content='text/html;charset=UTF-8'></head>" + htmlString;
    2.11 +                        }
    2.12 +                        else
    2.13 +                        {
    2.14 +                            htmlString = r.Replace(htmlString, m2.Value + "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>", 1);
    2.15 +                        }
    2.16                      }
    2.17                      else
    2.18                      {