summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/URIHandler/MacOSXURIHandlerHelpers.mm')
-rw-r--r--SwifTools/URIHandler/MacOSXURIHandlerHelpers.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/SwifTools/URIHandler/MacOSXURIHandlerHelpers.mm b/SwifTools/URIHandler/MacOSXURIHandlerHelpers.mm
new file mode 100644
index 0000000..dca91b8
--- /dev/null
+++ b/SwifTools/URIHandler/MacOSXURIHandlerHelpers.mm
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2011 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <SwifTools/URIHandler/MacOSXURIHandlerHelpers.h>
+
+#include <Cocoa/Cocoa.h>
+
+namespace Swift {
+ void registerAppAsDefaultXMPPURIHandler() {
+ NSString* bundleID = [[NSBundle mainBundle] bundleIdentifier];
+ LSSetDefaultHandlerForURLScheme((CFStringRef)@"xmpp", (CFStringRef)bundleID);
+ }
+}