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

Remove availability check for iOS 15 #1377

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions NextcloudTalk/ChatTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,12 @@ - (UIMenu *)getDeferredUserMenuForMessage:(NCChatMessage *)message

UIDeferredMenuElement *deferredMenuElement;

if (@available(iOS 15.0, *)) {
// When iOS 15 is available, we can use an uncached provider so local time is not cached for example
deferredMenuElement = [UIDeferredMenuElement elementWithUncachedProvider:^(void (^ _Nonnull completion)(NSArray<UIMenuElement *> * _Nonnull)) {
[self getMenuUserActionsForMessage:message withCompletionBlock:^(NSArray *menuItems) {
completion(menuItems);
}];
}];
} else {
deferredMenuElement = [UIDeferredMenuElement elementWithProvider:^(void (^ _Nonnull completion)(NSArray<UIMenuElement *> * _Nonnull)) {
[self getMenuUserActionsForMessage:message withCompletionBlock:^(NSArray *menuItems) {
completion(menuItems);
}];
// Use an uncached provider so local time is not cached
deferredMenuElement = [UIDeferredMenuElement elementWithUncachedProvider:^(void (^ _Nonnull completion)(NSArray<UIMenuElement *> * _Nonnull)) {
[self getMenuUserActionsForMessage:message withCompletionBlock:^(NSArray *menuItems) {
completion(menuItems);
}];
}
}];

return [UIMenu menuWithTitle:message.actorDisplayName children:@[deferredMenuElement]];
}
Expand Down
6 changes: 2 additions & 4 deletions NextcloudTalk/NCChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,8 @@ - (void)viewDidLoad
[self.autoCompletionView registerClass:[ChatMessageTableViewCell class] forCellReuseIdentifier:AutoCompletionCellIdentifier];
[self registerPrefixesForAutoCompletion:@[@"@"]];
self.autoCompletionView.backgroundColor = [UIColor secondarySystemBackgroundColor];

if (@available(iOS 15.0, *)) {
self.autoCompletionView.sectionHeaderTopPadding = 0;
}
self.autoCompletionView.sectionHeaderTopPadding = 0;

// Align separators to ChatMessageTableViewCell's title label
self.autoCompletionView.separatorInset = UIEdgeInsetsMake(0, 50, 0, 0);

Expand Down
6 changes: 2 additions & 4 deletions NextcloudTalk/RoomsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,8 @@ - (void)updateAccountPickerMenu
[[NCSettingsController sharedInstance] setActiveAccountWithAccountId:account.accountId];
}];

if (@available(iOS 15.0, *)) {
if (account.unreadBadgeNumber > 0) {
switchAccountAction.subtitle = [NSString localizedStringWithFormat:NSLocalizedString(@"%ld notifications", nil), (long)account.unreadBadgeNumber];
}
if (account.unreadBadgeNumber > 0) {
switchAccountAction.subtitle = [NSString localizedStringWithFormat:NSLocalizedString(@"%ld notifications", nil), (long)account.unreadBadgeNumber];
}

if (account.active) {
Expand Down
Loading