IOSAD-95 reEvaluateMessage with xKeyList
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 26 Jun 2018 08:35:53 +0200
changeset 6349d89bc605c1f
parent 633 e9078acc8b2a
child 635 ec6cc54d911d
IOSAD-95 reEvaluateMessage with xKeyList
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Tue Jun 19 18:53:51 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Tue Jun 26 08:35:53 2018 +0200
     1.3 @@ -205,21 +205,28 @@
     1.4  }
     1.5  
     1.6  - (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
     1.7 +                     xKeyList:(PEPStringList * _Nullable)xKeyList
     1.8                         rating:(PEP_rating * _Nonnull)rating
     1.9                         status:(PEP_STATUS * _Nullable)status
    1.10                          error:(NSError * _Nullable * _Nullable)error
    1.11  {
    1.12      message *_src = PEP_messageDictToStruct(messageDict);
    1.13  
    1.14 +    stringlist_t *theKeys = NULL;
    1.15 +    if ([xKeyList count]) {
    1.16 +        theKeys = PEP_arrayToStringlist(xKeyList);
    1.17 +    }
    1.18 +
    1.19      [self lockWrite];
    1.20      PEP_STATUS theStatus = re_evaluate_message_rating(_session,
    1.21                                                        _src,
    1.22 -                                                      NULL,
    1.23 +                                                      theKeys,
    1.24                                                        *rating,
    1.25                                                        rating);
    1.26      [self unlockWrite];
    1.27  
    1.28      free_message(_src);
    1.29 +    free_stringlist(theKeys);
    1.30  
    1.31      if (status) {
    1.32          *status = theStatus;
    1.33 @@ -233,11 +240,13 @@
    1.34  }
    1.35  
    1.36  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
    1.37 +                 xKeyList:(PEPStringList * _Nullable)xKeyList
    1.38                     rating:(PEP_rating * _Nonnull)rating
    1.39                     status:(PEP_STATUS * _Nullable)status
    1.40                      error:(NSError * _Nullable * _Nullable)error
    1.41  {
    1.42      return [self reEvaluateMessageDict:(PEPDict *) message
    1.43 +                              xKeyList:xKeyList
    1.44                                  rating:rating
    1.45                                  status:status
    1.46                                   error:error];
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Tue Jun 19 18:53:51 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Tue Jun 26 08:35:53 2018 +0200
     2.3 @@ -56,21 +56,31 @@
     2.4  }
     2.5  
     2.6  - (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
     2.7 +                     xKeyList:(PEPStringList * _Nullable)xKeyList
     2.8                         rating:(PEP_rating * _Nonnull)rating
     2.9                         status:(PEP_STATUS * _Nullable)status
    2.10                          error:(NSError * _Nullable * _Nullable)error
    2.11  {
    2.12      PEPInternalSession *session = [PEPSessionProvider session];
    2.13 -    return [session reEvaluateMessageDict:messageDict rating:rating status:status error:error];
    2.14 +    return [session reEvaluateMessageDict:messageDict
    2.15 +                                 xKeyList:xKeyList
    2.16 +                                   rating:rating
    2.17 +                                   status:status
    2.18 +                                    error:error];
    2.19  }
    2.20  
    2.21  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
    2.22 +                 xKeyList:(PEPStringList * _Nullable)xKeyList
    2.23                     rating:(PEP_rating * _Nonnull)rating
    2.24                     status:(PEP_STATUS * _Nullable)status
    2.25                      error:(NSError * _Nullable * _Nullable)error
    2.26  {
    2.27      PEPInternalSession *session = [PEPSessionProvider session];
    2.28 -    return [session reEvaluateMessage:message rating:rating status:status error:error];
    2.29 +    return [session reEvaluateMessage:message
    2.30 +                             xKeyList:xKeyList
    2.31 +                               rating:rating
    2.32 +                               status:status
    2.33 +                                error:error];
    2.34  }
    2.35  
    2.36  - (PEPDict * _Nullable)encryptMessageDict:(PEPDict * _Nonnull)messageDict
     3.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Tue Jun 19 18:53:51 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPSessionProtocol.h	Tue Jun 26 08:35:53 2018 +0200
     3.3 @@ -38,12 +38,14 @@
     3.4  
     3.5  /** Re-evaluate rating of decrypted message */
     3.6  - (BOOL)reEvaluateMessageDict:(PEPDict * _Nonnull)messageDict
     3.7 +                     xKeyList:(PEPStringList *_Nullable)xKeyList
     3.8                         rating:(PEP_rating * _Nonnull)rating
     3.9                         status:(PEP_STATUS * _Nullable)status
    3.10                          error:(NSError * _Nullable * _Nullable)error __deprecated;
    3.11  
    3.12  /** Re-evaluate rating of decrypted message */
    3.13  - (BOOL)reEvaluateMessage:(PEPMessage * _Nonnull)message
    3.14 +                 xKeyList:(PEPStringList *_Nullable)xKeyList
    3.15                     rating:(PEP_rating * _Nonnull)rating
    3.16                     status:(PEP_STATUS * _Nullable)status
    3.17                      error:(NSError * _Nullable * _Nullable)error;