Skip to content

Commit cb54bb8

Browse files
committed
Fix the share URL sheet on iPad, prevent long press gesture from also triggering link tap gesture
1 parent 8a48684 commit cb54bb8

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

IRCCloud/Classes/EventsTableView.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ - (void)viewDidLoad {
221221
self->_tableView.estimatedSectionFooterHeight = 0;
222222
lp = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_longPress:)];
223223
lp.minimumPressDuration = 1.0;
224+
lp.cancelsTouchesInView = YES;
224225
lp.delegate = self;
225226
[self->_tableView addGestureRecognizer:lp];
226227
self->_topUnreadView.backgroundColor = [UIColor chatterBarColor];

IRCCloud/Classes/LinkLabel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveT
5151
}
5252

5353
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
54-
return NO;
54+
return YES;
5555
}
5656

5757
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {

IRCCloud/Classes/MainViewController.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4328,6 +4328,7 @@ -(void)rowLongPressed:(Event *)event rect:(CGRect)rect link:(NSString *)url {
43284328
self->_selectedUser = nil;
43294329
}
43304330
self->_selectedEvent = event;
4331+
self->_selectedRect = rect;
43314332
self->_selectedURL = url;
43324333
if([self->_selectedURL hasPrefix:@"irccloud-paste-"])
43334334
self->_selectedURL = [self->_selectedURL substringFromIndex:15];
@@ -4871,9 +4872,9 @@ -(void)actionSheetActionClicked:(NSString *)action {
48714872
} else if([action isEqualToString:@"Share URL"]) {
48724873
[UIColor clearTheme];
48734874
UIActivityViewController *activityController = [URLHandler activityControllerForItems:@[[NSURL URLWithString:self->_selectedURL]] type:@"URL"];
4874-
activityController.popoverPresentationController.sourceView = self.slidingViewController.view;
4875-
activityController.popoverPresentationController.sourceRect = [self->_eventsView.tableView convertRect:self->_selectedRect toView:self.slidingViewController.view];
4876-
[self.slidingViewController presentViewController:activityController animated:YES completion:nil];
4875+
activityController.popoverPresentationController.sourceView = self.view;
4876+
activityController.popoverPresentationController.sourceRect = self->_selectedRect;
4877+
[self presentViewController:activityController animated:YES completion:nil];
48774878
} else if([action isEqualToString:@"Delete Message"]) {
48784879
[self dismissKeyboard];
48794880
[self.view.window endEditing:YES];

IRCCloud/Classes/NetworkConnection.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,10 @@ -(id)init {
384384
if([event isImportant:b.type]) {
385385
User *u = [self->_users getUser:event.from cid:event.cid bid:event.bid];
386386
if(u) {
387-
if(u.lastMessage < event.eid) {
387+
if(u.lastMessage < event.eid)
388388
u.lastMessage = event.eid;
389-
}
390-
if(event.isHighlight) {
391-
if(u.lastMention < event.eid) {
392-
u.lastMention = event.eid;
393-
}
394-
}
389+
if(event.isHighlight && u.lastMention < event.eid)
390+
u.lastMention = event.eid;
395391
}
396392
if(event.eid > b.last_seen_eid && (event.isHighlight || [b.type isEqualToString:@"conversation"])) {
397393
BOOL show = YES;

0 commit comments

Comments
 (0)