Accept ?roster action in QR URIs

This commit is contained in:
Matthew Wild 2020-12-18 15:07:37 +00:00
parent a43720a9df
commit ce28da52d5

View file

@ -101,7 +101,7 @@ class WelcomeController: UIViewController, QRScannerViewDelegate {
func found(code: String) {
print("found code: \(code)");
guard let url = URL(string: code), let xmppUri = AppDelegate.XmppUri(url: url), xmppUri.action == .register else {
guard let url = URL(string: code), let xmppUri = AppDelegate.XmppUri(url: url), (xmppUri.action == .register || xmppUri.action == .roster) else {
let alert = UIAlertController(title: "Error", message: "Scanned QR code is not valid for Snikket.", preferredStyle: .alert);
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil));
self.present(alert, animated: true, completion: nil);