Skip to content

Commit

Permalink
Merge pull request #888 from tchapgouv/882-ios-activer-desactiver-les…
Browse files Browse the repository at this point in the history
…-notifications-email

882 ios activer desactiver les notifications email
  • Loading branch information
NicolasBuquet authored Oct 12, 2023
2 parents 9eba487 + 01c8c86 commit 5109571
Show file tree
Hide file tree
Showing 10 changed files with 502 additions and 43 deletions.
40 changes: 38 additions & 2 deletions Riot/Modules/MatrixKit/Models/Account/MXKAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ extern NSString *const kMXKAccountUserInfoDidChangeNotification;
*/
extern NSString *const kMXKAccountAPNSActivityDidChangeNotification;

// Tchap: email notifications
/**
Posted when the activity of the Email Notification Service has been changed.
The notification object is the matrix user id of the account.
*/
extern NSString *const kMXKAccountEmailActivityDidChangeNotification;

/**
Posted when the activity of the Push notification based on PushKit has been changed.
The notification object is the matrix user id of the account.
Expand Down Expand Up @@ -307,13 +314,42 @@ typedef BOOL (^MXKAccountOnCertificateChange)(MXKAccount *mxAccount, NSData *cer
- (void)load3PIDs:(void (^)(void))success failure:(void (^)(NSError *error))failure;

/**
Loads the pusher instance linked to this account.
Loads the APNS pusher instance linked to this account.
This method must be called to refresh self.pushNotificationServiceIsActive
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
*/
- (void)loadCurrentPusher:(nullable void (^)(void))success failure:(nullable void (^)(NSError *error))failure;
- (void)loadCurrentApnsPusher:(nullable void (^)(void))success failure:(nullable void (^)(NSError *error))failure;

// Tchap: email notifications
/**
Enable Email notification.
This method creates or removes a pusher on the homeserver.
@param enable YES to enable it.
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
*/
- (void)enableEmailNotifications:(BOOL)enable
success:(void (^)(void))success
failure:(void (^)(NSError *))failure;

// Tchap: email notifications
/**
The Email Notification Service activity for this account. YES when Email notification service is turned on (locally available and synced with server).
*/
@property (nonatomic, readonly) BOOL emailNotificationServiceIsActive;

/**
Loads the Email pusher instance linked to this account.
This method must be called to refresh self.emailNotificationServiceIsActive
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
*/
- (void)loadCurrentEmailPusher:(nullable void (^)(void))success failure:(nullable void (^)(NSError *error))failure;

/**
Load the current device information for this account.
Expand Down
Loading

0 comments on commit 5109571

Please sign in to comment.