OUT-429: Reply to encrypted mail instead of replying to mirror. OUT-429
authornikolaj
Fri, 11 May 2018 18:10:14 +0200
branchOUT-429
changeset 2187a4b790cb6178
parent 2185 a3f839db149f
OUT-429: Reply to encrypted mail instead of replying to mirror.
UI/FormRegionPreviewUnencrypted.cs
     1.1 --- a/UI/FormRegionPreviewUnencrypted.cs	Thu May 10 15:04:25 2018 +0200
     1.2 +++ b/UI/FormRegionPreviewUnencrypted.cs	Fri May 11 18:10:14 2018 +0200
     1.3 @@ -234,10 +234,23 @@
     1.4  
     1.5              try
     1.6              {
     1.7 -                // Get the mirror and open it for reply
     1.8 +                // Get the mirror 
     1.9                  mirror = this.mailItem.GetMirror();
    1.10 +                
    1.11 +                //Reply to original mail
    1.12 +                responseItem = this.mailItem.Reply();
    1.13  
    1.14 -                responseItem = mirror.Reply();
    1.15 +                //  create reply headers from mirror 
    1.16 +                string htmlReplyFrom = "<br><hr><br><b>From: </b>" + mailItem.Sender.Name + " [" + mailItem.Sender.Address + "]<br>";
    1.17 +                string htmlReplySent = "<b>Sent: </b>" + mailItem.SentOn + "<br>";
    1.18 +                string htmlReplyTo = "<b>To: </b>" + mailItem.To + "<br>";
    1.19 +                string htmlReplySubject = "<b>Subject: </b>" + mirror.Subject + "<br><br>";
    1.20 +
    1.21 +                // Copy HTMLBody and reply headers from mirror to response mail HTMLBody
    1.22 +                responseItem.HTMLBody = htmlReplyFrom + htmlReplySent + htmlReplyTo + htmlReplySubject + mirror.HTMLBody;
    1.23 +               
    1.24 +                // Breaks conversation view!!!
    1.25 +                // responseItem.Subject = "Re: " + mirror.Subject;
    1.26  
    1.27                  // Set the encryption status of the original as user property in the reply item
    1.28                  responseItem.SetOriginallyEncryptedStatus(mirror.GetStoredRating() ?? pEpRating.pEpRatingUndefined);