IOSAD-123 Eliminate duplicate (and buggy) method. IOSAD-123
authorDirk Zimmermann <dz@pep.security>
Tue, 23 Jul 2019 16:05:32 +0200
branchIOSAD-123
changeset 109694a663ebfb1a
parent 1095 e05c56cab4c5
child 1097 e4bd8bed57d9
IOSAD-123 Eliminate duplicate (and buggy) method.
pEpObjCAdapter/NSMutableDictionary+PEP.m
pEpObjCAdapter/PEPMessageUtil.h
pEpObjCAdapter/PEPMessageUtil.m
     1.1 --- a/pEpObjCAdapter/NSMutableDictionary+PEP.m	Tue Jul 23 16:05:32 2019 +0200
     1.2 +++ b/pEpObjCAdapter/NSMutableDictionary+PEP.m	Tue Jul 23 16:05:32 2019 +0200
     1.3 @@ -41,7 +41,7 @@
     1.4      }
     1.5      
     1.6      if (message->to && message->to->ident) {
     1.7 -        [dict setValue:PEP_identityArrayFromList(message->to) forKey:kPepTo];
     1.8 +        [dict setValue:PEP_arrayFromIdentityList(message->to) forKey:kPepTo];
     1.9      }
    1.10      
    1.11      if (message->recv_by) {
    1.12 @@ -49,15 +49,15 @@
    1.13      }
    1.14      
    1.15      if (message->cc && message->cc->ident) {
    1.16 -        [dict setValue:PEP_identityArrayFromList(message->cc) forKey:kPepCC];
    1.17 +        [dict setValue:PEP_arrayFromIdentityList(message->cc) forKey:kPepCC];
    1.18      }
    1.19      
    1.20      if (message->bcc && message->bcc->ident) {
    1.21 -        [dict setValue:PEP_identityArrayFromList(message->bcc) forKey:kPepBCC];
    1.22 +        [dict setValue:PEP_arrayFromIdentityList(message->bcc) forKey:kPepBCC];
    1.23      }
    1.24      
    1.25      if (message->reply_to && message->reply_to->ident) {
    1.26 -        [dict setValue:PEP_identityArrayFromList(message->reply_to) forKey:kPepReplyTo];
    1.27 +        [dict setValue:PEP_arrayFromIdentityList(message->reply_to) forKey:kPepReplyTo];
    1.28      }
    1.29      
    1.30      if (message->in_reply_to) {
     2.1 --- a/pEpObjCAdapter/PEPMessageUtil.h	Tue Jul 23 16:05:32 2019 +0200
     2.2 +++ b/pEpObjCAdapter/PEPMessageUtil.h	Tue Jul 23 16:05:32 2019 +0200
     2.3 @@ -35,6 +35,5 @@
     2.4  message * _Nullable PEP_messageDictToStruct(NSDictionary * _Nullable dict);
     2.5  NSDictionary * _Nonnull PEP_messageDictFromStruct(message * _Nullable msg);
     2.6  
     2.7 -NSArray * _Nonnull PEP_identityArrayFromList(identity_list * _Nonnull il);
     2.8  NSArray * _Nonnull PEP_arrayFromStringPairlist(stringpair_list_t * _Nonnull sl);
     2.9  NSArray * _Nonnull PEP_arrayFromBloblist(bloblist_t * _Nonnull bl);
     3.1 --- a/pEpObjCAdapter/PEPMessageUtil.m	Tue Jul 23 16:05:32 2019 +0200
     3.2 +++ b/pEpObjCAdapter/PEPMessageUtil.m	Tue Jul 23 16:05:32 2019 +0200
     3.3 @@ -267,18 +267,6 @@
     3.4      return il;
     3.5  }
     3.6  
     3.7 -NSArray *PEP_identityArrayFromList(identity_list *il)
     3.8 -{
     3.9 -    NSMutableArray *array = [NSMutableArray array];
    3.10 -    
    3.11 -    for (identity_list *_il = il; _il && _il->ident; _il = _il->next) {
    3.12 -        PEPIdentity *ident = PEP_identityFromStruct(_il->ident);
    3.13 -        [array addObject:ident];
    3.14 -    }
    3.15 -    
    3.16 -    return array;
    3.17 -}
    3.18 -
    3.19  NSDictionary *PEP_messageDictFromStruct(message *msg)
    3.20  {
    3.21      NSMutableDictionary *dict = [NSMutableDictionary new];