@@ -452,6 +452,12 @@ -(BOOL) application:(UIApplication*) application didFinishLaunchingWithOptions:(
452452 actionWithIdentifier: @" DENY_SUBSCRIPTION_ACTION"
453453 title: NSLocalizedString(@" Deny new contact" , @" " )
454454 options: UNNotificationActionOptionNone
455+ icon: [UNNotificationActionIcon iconWithSystemImageName: @" person.crop.circle.badge.minus" ]
456+ ];
457+ UNNotificationAction * blockSubscriptionAction = [UNNotificationAction
458+ actionWithIdentifier: @" BLOCK_SUBSCRIPTION_ACTION"
459+ title: NSLocalizedString(@" Block new contact" , @" " )
460+ options: UNNotificationActionOptionNone
455461 icon: [UNNotificationActionIcon iconWithSystemImageName: @" person.crop.circle.badge.xmark" ]
456462 ];
457463
@@ -467,7 +473,7 @@ -(BOOL) application:(UIApplication*) application didFinishLaunchingWithOptions:(
467473 ];
468474 UNNotificationCategory * subscriptionCategory = [UNNotificationCategory
469475 categoryWithIdentifier: @" subscription"
470- actions: @[approveSubscriptionAction, denySubscriptionAction]
476+ actions: @[approveSubscriptionAction, denySubscriptionAction, blockSubscriptionAction ]
471477 intentIdentifiers: @[]
472478 options: UNNotificationCategoryOptionCustomDismissAction
473479 ];
@@ -998,6 +1004,12 @@ -(void) userNotificationCenter:(UNUserNotificationCenter*) center didReceiveNoti
9981004 DDLogInfo (@" DENY_SUBSCRIPTION_ACTION triggered..." );
9991005 [[MLXMPPManager sharedInstance ] removeContact: fromContact];
10001006 }
1007+ else if ([response.actionIdentifier isEqualToString: @" BLOCK_SUBSCRIPTION_ACTION" ])
1008+ {
1009+ DDLogInfo (@" BLOCK_SUBSCRIPTION_ACTION triggered..." );
1010+ [[MLXMPPManager sharedInstance ] removeContact: fromContact];
1011+ [[MLXMPPManager sharedInstance ] block: YES contact: fromContact];
1012+ }
10011013 else if ([response.actionIdentifier isEqualToString: @" com.apple.UNNotificationDefaultActionIdentifier" ]) // open chat of this contact
10021014 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0 ), ^{
10031015 while (self.activeChats == nil )
0 commit comments