IOSAD-103 dealing correctly with protocols IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 05 Oct 2018 16:35:52 +0200
branchIOSAD-103
changeset 704f5036c40fbd8
parent 703 44a044464056
child 705 90b7d3ed756c
IOSAD-103 dealing correctly with protocols
pEpObjCAdapter/PEPSync.m
     1.1 --- a/pEpObjCAdapter/PEPSync.m	Fri Oct 05 16:35:52 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSync.m	Fri Oct 05 16:35:52 2018 +0200
     1.3 @@ -9,6 +9,7 @@
     1.4  #import "PEPSync.h"
     1.5  
     1.6  #import "PEPSyncSendMessageDelegate.h"
     1.7 +#import "PEPNotifyHandshakeDelegate.h"
     1.8  #import "PEPMessageUtil.h"
     1.9  #import "PEPMessage.h"
    1.10  #import "PEPQueue.h"
    1.11 @@ -19,8 +20,8 @@
    1.12  
    1.13  + (PEPSync * _Nullable)instance;
    1.14  
    1.15 -@property (nonatomic, nullable, weak) PEPSyncSendMessageDelegate *syncSendMessageDelegate;
    1.16 -@property (nonatomic, nullable, weak) PEPNotifyHandshakeDelegate *notifyHandshakeDelegate;
    1.17 +@property (nonatomic, nullable, weak) id<PEPSyncSendMessageDelegate> syncSendMessageDelegate;
    1.18 +@property (nonatomic, nullable, weak) id<PEPNotifyHandshakeDelegate> notifyHandshakeDelegate;
    1.19  @property (nonatomic, nonnull) PEPQueue *queue;
    1.20  
    1.21  - (int)injectSyncEvent:(SYNC_EVENT)event;
    1.22 @@ -31,7 +32,7 @@
    1.23  
    1.24  PEP_STATUS messageToSendObjc(struct _message *msg)
    1.25  {
    1.26 -    PEPSyncSendMessageDelegate *delegate = [[PEPSync instance] syncSendMessageDelegate];
    1.27 +    id<PEPSyncSendMessageDelegate> delegate = [[PEPSync instance] syncSendMessageDelegate];
    1.28      if (delegate) {
    1.29          PEPMessage *theMessage = pEpMessageFromStruct(msg);
    1.30          return [delegate sendMessage:theMessage];
    1.31 @@ -68,9 +69,9 @@
    1.32      return s_pEpSync;
    1.33  }
    1.34  
    1.35 -- (instancetype)initWithSyncSendMessageDelegate:(PEPSyncSendMessageDelegate *
    1.36 +- (instancetype)initWithSyncSendMessageDelegate:(id<PEPSyncSendMessageDelegate>
    1.37                                                   _Nonnull)syncSendMessageDelegate
    1.38 -                        notifyHandshakeDelegate:(PEPNotifyHandshakeDelegate *
    1.39 +                        notifyHandshakeDelegate:(id<PEPNotifyHandshakeDelegate>
    1.40                                                   _Nonnull)notifyHandshakeDelegate
    1.41  {
    1.42      if (self = [super init]) {