IOSAD-172 Convert reEvaluateMessageDict IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Sat, 27 Jun 2020 14:02:48 +0200
branchIOSAD-172
changeset 1506264e11853a2b
parent 1505 807e165af6c1
child 1507 b0474a0ced9d
IOSAD-172 Convert reEvaluateMessageDict
pEpObjCAdapter/PEPInternalSession.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Sat Jun 27 13:27:42 2020 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Sat Jun 27 14:02:48 2020 +0200
     1.3 @@ -190,18 +190,23 @@
     1.4                         status:(PEPStatus * _Nullable)status
     1.5                          error:(NSError * _Nullable * _Nullable)error
     1.6  {
     1.7 -    message *_src = PEP_messageDictToStruct(messageDict);
     1.8 +    __block PEPRating *theRating = rating;
     1.9 +    __block message *_src = PEP_messageDictToStruct(messageDict);
    1.10  
    1.11 -    stringlist_t *theKeys = NULL;
    1.12 +    __block stringlist_t *theKeys = NULL;
    1.13      if ([xKeyList count]) {
    1.14          theKeys = PEP_arrayToStringlist(xKeyList);
    1.15      }
    1.16  
    1.17 -    PEPStatus theStatus = (PEPStatus) re_evaluate_message_rating(_session,
    1.18 -                                                                 _src,
    1.19 -                                                                 theKeys,
    1.20 -                                                                 (PEP_rating) *rating,
    1.21 -                                                                 (PEP_rating *) rating);
    1.22 +    PEPStatus theStatus = (PEPStatus) [self runWithPasswords:^PEP_STATUS(PEP_SESSION session) {
    1.23 +        return re_evaluate_message_rating(session,
    1.24 +                                          _src,
    1.25 +                                          theKeys,
    1.26 +                                          (PEP_rating) *rating,
    1.27 +                                          (PEP_rating *) theRating);
    1.28 +    }];
    1.29 +
    1.30 +    *rating = *theRating;
    1.31  
    1.32      free_message(_src);
    1.33      free_stringlist(theKeys);