IOSAD-101 no undo_last_mistrust anymore IOSAD-101
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 18 Sep 2018 12:40:57 +0200
branchIOSAD-101
changeset 6586ad1a4ca6509
parent 657 98644e8a03cc
child 659 cca9ed8c89d0
IOSAD-101 no undo_last_mistrust anymore
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Tue Sep 18 12:40:57 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Tue Sep 18 12:40:57 2018 +0200
     1.3 @@ -794,19 +794,6 @@
     1.4      return [NSArray arrayWithArray:langs];
     1.5  }
     1.6  
     1.7 -- (BOOL)undoLastMistrustWithError:(NSError * _Nullable * _Nullable)error;
     1.8 -{
     1.9 -    [self lockWrite];
    1.10 -    PEP_STATUS status = undo_last_mistrust(_session);
    1.11 -    [self unlockWrite];
    1.12 -
    1.13 -    if ([NSError setError:error fromPEPStatus:status]) {
    1.14 -        return NO;
    1.15 -    }
    1.16 -
    1.17 -    return YES;
    1.18 -}
    1.19 -
    1.20  static NSDictionary *ratingToString;
    1.21  static NSDictionary *stringToRating;
    1.22  
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Tue Sep 18 12:40:57 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Tue Sep 18 12:40:57 2018 +0200
     2.3 @@ -303,12 +303,6 @@
     2.4      return [session languageListWithError:error];
     2.5  }
     2.6  
     2.7 -- (BOOL)undoLastMistrustWithError:(NSError * _Nullable * _Nullable)error;
     2.8 -{
     2.9 -    PEPInternalSession *session = [PEPSessionProvider session];
    2.10 -    return [session undoLastMistrustWithError:error];
    2.11 -}
    2.12 -
    2.13  - (PEP_rating)ratingFromString:(NSString * _Nonnull)string
    2.14  {
    2.15      PEPInternalSession *session = [PEPSessionProvider session];
     3.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Tue Sep 18 12:40:57 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPSessionProtocol.h	Tue Sep 18 12:40:57 2018 +0200
     3.3 @@ -212,11 +212,6 @@
     3.4  - (NSArray<PEPLanguage *> * _Nullable)languageListWithError:(NSError * _Nullable * _Nullable)error;
     3.5  
     3.6  /**
     3.7 - Directly invokes the engine's undo_last_mistrust() function
     3.8 - */
     3.9 -- (BOOL)undoLastMistrustWithError:(NSError * _Nullable * _Nullable)error;
    3.10 -
    3.11 -/**
    3.12   Can convert a string like "cannot_decrypt" into its equivalent PEP_rating_cannot_decrypt.
    3.13   */
    3.14  - (PEP_rating)ratingFromString:(NSString * _Nonnull)string;
     4.1 --- a/pEpObjCTests/PEPSessionTest.m	Tue Sep 18 12:40:57 2018 +0200
     4.2 +++ b/pEpObjCTests/PEPSessionTest.m	Tue Sep 18 12:40:57 2018 +0200
     4.3 @@ -288,9 +288,6 @@
     4.4      XCTAssertNil(error);
     4.5      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
     4.6  
     4.7 -    XCTAssertTrue([session undoLastMistrustWithError:&error]);
     4.8 -    XCTAssertNil(error);
     4.9 -
    4.10      // After ENGINE-371 has been fixed, this should be just PEP_rating_reliable
    4.11      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
    4.12  
    4.13 @@ -341,9 +338,6 @@
    4.14      XCTAssertNil(error);
    4.15      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    4.16  
    4.17 -    XCTAssertTrue([session undoLastMistrustWithError:&error]);
    4.18 -    XCTAssertNil(error);
    4.19 -
    4.20      XCTAssertTrue([session trustPersonalKey:alice error:&error]);
    4.21      XCTAssertNil(error);
    4.22      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
    4.23 @@ -421,9 +415,6 @@
    4.24      XCTAssertNil(error);
    4.25      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    4.26  
    4.27 -    XCTAssertTrue([session undoLastMistrustWithError:&error]);
    4.28 -    XCTAssertNil(error);
    4.29 -
    4.30      // After ENGINE-371 has been fixed, this should be just PEP_rating_reliable
    4.31      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_trusted);
    4.32  
    4.33 @@ -547,7 +538,6 @@
    4.34      XCTAssertEqual(numRating.pEpRating, PEP_rating_unencrypted);
    4.35  
    4.36      // Undo
    4.37 -    XCTAssertTrue([session undoLastMistrustWithError:&error]);
    4.38      XCTAssertNil(error);
    4.39      XCTAssertTrue([session updateIdentity:identBob error:&error]);
    4.40      XCTAssertNil(error);