OUT-411: Take into account special case of forcefully encrypted messages during sending.
authorThomas
Wed, 28 Feb 2018 16:55:04 +0100
changeset 20242b6921290607
parent 2023 65519fb6865c
child 2025 16d165ee211e
OUT-411: Take into account special case of forcefully encrypted messages during sending.
MsgProcessor.cs
     1.1 --- a/MsgProcessor.cs	Wed Feb 28 13:07:02 2018 +0100
     1.2 +++ b/MsgProcessor.cs	Wed Feb 28 16:55:04 2018 +0100
     1.3 @@ -716,12 +716,13 @@
     1.4                      result = this.Encrypt(encryptedMessages[i], extraKeys, out newMessage);
     1.5                      encryptedMessages[i] = newMessage;
     1.6  
     1.7 -                    // Check to ensure the message was really encrypted
     1.8 -                    // This is just a double check against presenting the user with one rating, but actually delivering another.
     1.9 -                    // If this happens, an error occured elsewhere, likely in the engine
    1.10 +                    /* Check to ensure the message was really encrypted.
    1.11 +                     * This is just a double check against presenting the user with one rating, but actually delivering another.
    1.12 +                     * If message is unencrypted (and no forcefully encrypted message), an error occured elsewhere, likely in the engine.
    1.13 +                     */
    1.14                      if ((result == false) ||
    1.15                          ((outgoingRating >= pEpRating.pEpRatingReliable) &&
    1.16 -                         (newMessage.IsSecure == false)))
    1.17 +                         ((newMessage.IsSecure == false) && string.IsNullOrEmpty(newMessage.ForceProtectionId))))
    1.18                      {
    1.19                          status = Globals.ReturnStatus.Failure;
    1.20                          Log.Error("ProcessSentMessage: Message encryption failed or doesn't match outgoing rating.");