IOSAD-103 delegate any message to send IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 05 Oct 2018 12:09:01 +0200
branchIOSAD-103
changeset 6881b3d9f1481df
parent 687 5352ef112320
child 689 e14aa984e320
IOSAD-103 delegate any message to send
pEpObjCAdapter/PEPSync.m
pEpObjCAdapter/PEPSyncSendMessageDelegate.h
     1.1 --- a/pEpObjCAdapter/PEPSync.m	Fri Oct 05 12:09:01 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSync.m	Fri Oct 05 12:09:01 2018 +0200
     1.3 @@ -9,9 +9,17 @@
     1.4  #import "PEPSync.h"
     1.5  
     1.6  #import "PEPSyncSendMessageDelegate.h"
     1.7 +#import "PEPMessageUtil.h"
     1.8 +#import "PEPMessage.h"
     1.9  
    1.10  PEP_STATUS messageToSendObjc(struct _message *msg)
    1.11  {
    1.12 +    PEPSyncSendMessageDelegate *delegate = [PEPSync syncSendMessageDelegate];
    1.13 +    if (delegate) {
    1.14 +        PEPMessage *theMessage = pEpMessageFromStruct(msg);
    1.15 +        return [delegate sendMessage:theMessage];
    1.16 +    }
    1.17 +
    1.18      return PEP_STATUS_OK;
    1.19  }
    1.20  
     2.1 --- a/pEpObjCAdapter/PEPSyncSendMessageDelegate.h	Fri Oct 05 12:09:01 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSyncSendMessageDelegate.h	Fri Oct 05 12:09:01 2018 +0200
     2.3 @@ -8,10 +8,12 @@
     2.4  
     2.5  #import <Foundation/Foundation.h>
     2.6  
     2.7 -NS_ASSUME_NONNULL_BEGIN
     2.8 +#import "pEpEngine.h"
     2.9 +
    2.10 +@class PEPMessage;
    2.11  
    2.12  @interface PEPSyncSendMessageDelegate : NSObject
    2.13  
    2.14 +- (PEP_STATUS)sendMessage:(PEPMessage * _Nonnull)message;
    2.15 +
    2.16  @end
    2.17 -
    2.18 -NS_ASSUME_NONNULL_END