Skip to content

Commit

Permalink
Revert "Add new action to block subscription requests, fixes #1320"
Browse files Browse the repository at this point in the history
This reverts commit 733f7d5.
  • Loading branch information
tmolitor-stud-tu authored Jan 4, 2025
1 parent 17ca048 commit da51a6d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
11 changes: 0 additions & 11 deletions Monal/Classes/ContactRequestsMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ struct ContactRequestsMenuEntry: View {
//see https://www.hackingwithswift.com/forums/swiftui/tap-button-in-hstack-activates-all-button-actions-ios-14-swiftui-2/2952
.buttonStyle(BorderlessButtonStyle())

Button {
// deny request
MLXMPPManager.sharedInstance().remove(contact)
MLXMPPManager.sharedInstance().block(true, contact:contact)
} label: {
Image(systemName: "xmark.circle")
.foregroundStyle(Color.red)
}
//see https://www.hackingwithswift.com/forums/swiftui/tap-button-in-hstack-activates-all-button-actions-ios-14-swiftui-2/2952
.buttonStyle(BorderlessButtonStyle())

Button {
// deny request
MLXMPPManager.sharedInstance().remove(contact)
Expand Down
19 changes: 1 addition & 18 deletions Monal/Classes/MonalAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,6 @@ -(BOOL) application:(UIApplication*) application didFinishLaunchingWithOptions:(
title:NSLocalizedString(@"Deny new contact", @"")
options:UNNotificationActionOptionNone
];
UNNotificationAction* blockSubscriptionAction = [UNNotificationAction
actionWithIdentifier:@"BLOCK_SUBSCRIPTION_ACTION"
title:NSLocalizedString(@"Block new contact", @"")
options:UNNotificationActionOptionNone
];
if(@available(iOS 15.0, macCatalyst 15.0, *))
{
replyAction = [UNTextInputNotificationAction
Expand All @@ -474,12 +469,6 @@ -(BOOL) application:(UIApplication*) application didFinishLaunchingWithOptions:(
actionWithIdentifier:@"DENY_SUBSCRIPTION_ACTION"
title:NSLocalizedString(@"Deny new contact", @"")
options:UNNotificationActionOptionNone
icon:[UNNotificationActionIcon iconWithSystemImageName:@"person.crop.circle.badge.minus"]
];
blockSubscriptionAction = [UNNotificationAction
actionWithIdentifier:@"BLOCK_SUBSCRIPTION_ACTION"
title:NSLocalizedString(@"Block new contact", @"")
options:UNNotificationActionOptionNone
icon:[UNNotificationActionIcon iconWithSystemImageName:@"person.crop.circle.badge.xmark"]
];
}
Expand All @@ -495,7 +484,7 @@ -(BOOL) application:(UIApplication*) application didFinishLaunchingWithOptions:(
];
UNNotificationCategory* subscriptionCategory = [UNNotificationCategory
categoryWithIdentifier:@"subscription"
actions:@[approveSubscriptionAction, denySubscriptionAction, blockSubscriptionAction]
actions:@[approveSubscriptionAction, denySubscriptionAction]
intentIdentifiers:@[]
options:UNNotificationCategoryOptionCustomDismissAction
];
Expand Down Expand Up @@ -1023,12 +1012,6 @@ -(void) userNotificationCenter:(UNUserNotificationCenter*) center didReceiveNoti
DDLogInfo(@"DENY_SUBSCRIPTION_ACTION triggered...");
[[MLXMPPManager sharedInstance] removeContact:fromContact];
}
else if([response.actionIdentifier isEqualToString:@"BLOCK_SUBSCRIPTION_ACTION"])
{
DDLogInfo(@"BLOCK_SUBSCRIPTION_ACTION triggered...");
[[MLXMPPManager sharedInstance] removeContact:fromContact];
[[MLXMPPManager sharedInstance] block:YES contact:fromContact];
}
else if([response.actionIdentifier isEqualToString:@"com.apple.UNNotificationDefaultActionIdentifier"]) //open chat of this contact
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
while(self.activeChats == nil)
Expand Down

0 comments on commit da51a6d

Please sign in to comment.