adium 3530:0a658933d3ad: Now really fix (null) hosts. Silly me n...

commits at adium.im commits at adium.im
Mon Nov 15 14:01:44 UTC 2010


details:	http://hg.adium.im/adium/rev/0a658933d3ad
revision:	3530:0a658933d3ad
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Mon Nov 15 15:00:47 2010 +0100

Now really fix (null) hosts. Silly me not testing first...

diffs (57 lines):

diff -r 25a2b8bdc366 -r 0a658933d3ad Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Mon Nov 15 13:47:24 2010 +0100
+++ b/Adium.xcodeproj/project.pbxproj	Mon Nov 15 15:00:47 2010 +0100
@@ -9699,7 +9699,6 @@
 			};
 			buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,
diff -r 25a2b8bdc366 -r 0a658933d3ad Source/AIURLHandlerPlugin.m
--- a/Source/AIURLHandlerPlugin.m	Mon Nov 15 13:47:24 2010 +0100
+++ b/Source/AIURLHandlerPlugin.m	Mon Nov 15 15:00:47 2010 +0100
@@ -234,7 +234,7 @@
 	
 	//make sure we have the // in ://, as it simplifies later processing.
 	if (![[url resourceSpecifier] hasPrefix:@"//"]) {
-		urlString = [NSString stringWithFormat:@"%@://%@", [url scheme], [url resourceSpecifier]];
+		urlString = [NSString stringWithFormat:@"%@://%@", [url scheme], ([url resourceSpecifier] ?: @"")];
 		url = [NSURL URLWithString:urlString];
 	}
 	
@@ -407,11 +407,10 @@
 		} else if ([scheme caseInsensitiveCompare:@"irc"] == NSOrderedSame) {
 			// irc://server:port/channel?password
 			NSString *channelName = [url fragment];
-			NSString *hostName = [url host];
 			NSNumber *portNumber = [url port];
 			NSInteger port;
 			
-			if (!channelName.length && [url.path.lastPathComponent isEqualToString:@"/"]) {
+			if (!channelName.length && (!url.path.lastPathComponent || [url.path.lastPathComponent isEqualToString:@"/"])) {
 				channelName = @"#";
 			} else if (!channelName.length) {
 				channelName = url.path.lastPathComponent;
@@ -424,16 +423,16 @@
 			if (portNumber == nil) {
 				port = -1;
 			} else {
-				port = [portNumber intValue];
+				port = [portNumber integerValue];
 			}
 			
-			if (!hostName.length) {
-				hostName = @"";
+			if (!host) {
+				host = @"";
 			}
 			
 			channelName = [channelName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
 			
-			[self _openIRCGroupChat:channelName onServer:hostName withPort:port andPassword:[url query]];
+			[self _openIRCGroupChat:channelName onServer:host withPort:port andPassword:[url query]];
 		} else if ([scheme caseInsensitiveCompare:@"msim"] == NSOrderedSame) {
 			NSString *contactName = [url queryArgumentForKey:@"cID"];
 			




More information about the commits mailing list