Skip to content

Commit

Permalink
Fix the share URL sheet on iPad, prevent long press gesture from also…
Browse files Browse the repository at this point in the history
… triggering link tap gesture
  • Loading branch information
c99koder committed Jan 23, 2020
1 parent 8a48684 commit cb54bb8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions IRCCloud/Classes/EventsTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ - (void)viewDidLoad {
self->_tableView.estimatedSectionFooterHeight = 0;
lp = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_longPress:)];
lp.minimumPressDuration = 1.0;
lp.cancelsTouchesInView = YES;
lp.delegate = self;
[self->_tableView addGestureRecognizer:lp];
self->_topUnreadView.backgroundColor = [UIColor chatterBarColor];
Expand Down
2 changes: 1 addition & 1 deletion IRCCloud/Classes/LinkLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveT
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return NO;
return YES;
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
Expand Down
7 changes: 4 additions & 3 deletions IRCCloud/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -4328,6 +4328,7 @@ -(void)rowLongPressed:(Event *)event rect:(CGRect)rect link:(NSString *)url {
self->_selectedUser = nil;
}
self->_selectedEvent = event;
self->_selectedRect = rect;
self->_selectedURL = url;
if([self->_selectedURL hasPrefix:@"irccloud-paste-"])
self->_selectedURL = [self->_selectedURL substringFromIndex:15];
Expand Down Expand Up @@ -4871,9 +4872,9 @@ -(void)actionSheetActionClicked:(NSString *)action {
} else if([action isEqualToString:@"Share URL"]) {
[UIColor clearTheme];
UIActivityViewController *activityController = [URLHandler activityControllerForItems:@[[NSURL URLWithString:self->_selectedURL]] type:@"URL"];
activityController.popoverPresentationController.sourceView = self.slidingViewController.view;
activityController.popoverPresentationController.sourceRect = [self->_eventsView.tableView convertRect:self->_selectedRect toView:self.slidingViewController.view];
[self.slidingViewController presentViewController:activityController animated:YES completion:nil];
activityController.popoverPresentationController.sourceView = self.view;
activityController.popoverPresentationController.sourceRect = self->_selectedRect;
[self presentViewController:activityController animated:YES completion:nil];
} else if([action isEqualToString:@"Delete Message"]) {
[self dismissKeyboard];
[self.view.window endEditing:YES];
Expand Down
10 changes: 3 additions & 7 deletions IRCCloud/Classes/NetworkConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,10 @@ -(id)init {
if([event isImportant:b.type]) {
User *u = [self->_users getUser:event.from cid:event.cid bid:event.bid];
if(u) {
if(u.lastMessage < event.eid) {
if(u.lastMessage < event.eid)
u.lastMessage = event.eid;
}
if(event.isHighlight) {
if(u.lastMention < event.eid) {
u.lastMention = event.eid;
}
}
if(event.isHighlight && u.lastMention < event.eid)
u.lastMention = event.eid;
}
if(event.eid > b.last_seen_eid && (event.isHighlight || [b.type isEqualToString:@"conversation"])) {
BOOL show = YES;
Expand Down

0 comments on commit cb54bb8

Please sign in to comment.