ios: fix opening hyperlinks

This was added in commit 2174206de1 (android:
Don't hang after returning from a hyperlink., 2020-02-14), but the new command
was only handled on Android. Handle HYPERLINK on iOS, too.

Change-Id: I8c942c1a64c8a52462a749989e312d0d9899a841
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90917
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
This commit is contained in:
Miklos Vajna 2020-03-23 14:39:27 +01:00
parent d38106d5cc
commit 6890d2fdaa

View file

@ -441,6 +441,14 @@ static IMP standardImpOfInputAccessoryView = nil;
}];
return;
} else if ([message.body hasPrefix:@"HYPERLINK"]) {
NSArray *messageBodyItems = [message.body componentsSeparatedByString:@" "];
if ([messageBodyItems count] >= 2) {
NSURL *url = [[NSURL alloc] initWithString:messageBodyItems[1]];
UIApplication *application = [UIApplication sharedApplication];
[application openURL:url options:@{} completionHandler:nil];
return;
}
}
const char *buf = [message.body UTF8String];