Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

882 ios activer desactiver les notifications email #888

Merged
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
Loading