Sort of the patch from '''tuttle''' to fix joining XMPP group chats from their URL handler. Fixes #11785.
authorZachary West <zacw@adiumx.com>
Tue, 28 Apr 2009 12:11:08 -0400
changeset 201959d25d4df621
parent 2018 c0f142ff6f98
child 2020 68ec2a67f7dc
Sort of the patch from '''tuttle''' to fix joining XMPP group chats from their URL handler. Fixes #11785.

We were creating two chats, one without the @server.tld suffix, which was confusing us. I am not including the nick-specifying arguments from the patch, since they are nonstandard and potentially confusing.
Source/AIURLHandlerPlugin.m
     1.1 --- a/Source/AIURLHandlerPlugin.m	Tue Apr 28 11:56:39 2009 -0400
     1.2 +++ b/Source/AIURLHandlerPlugin.m	Tue Apr 28 12:11:08 2009 -0400
     1.3 @@ -390,10 +390,8 @@
     1.4  				// xmpp:johndoe@jabber.org?remove
     1.5  				// xmpp:johndoe@jabber.org?unsubscribe
     1.6  				
     1.7 -			} else if (([query caseInsensitiveCompare:@"join"] == NSOrderedSame) &&
     1.8 -					   ([scheme caseInsensitiveCompare:@"xmpp"] == NSOrderedSame)) {
     1.9 +			} else if ([query rangeOfString:@"join"].location == 0) {
    1.10  				NSString *password = [[url queryArgumentForKey:@"password"] stringByDecodingURLEscapes];
    1.11 -				//TODO: password support: xmpp:darkcave@macbeth.shakespeare.lit?join;password=cauldronburn
    1.12  				
    1.13  				[self _openXMPPGroupChat:[url user]
    1.14  								onServer:[url host]
    1.15 @@ -529,15 +527,15 @@
    1.16  	}
    1.17  	
    1.18  	if (name && account) {
    1.19 -		[adium.chatController chatWithName:name
    1.20 -		 identifier:nil
    1.21 -		 onAccount:account
    1.22 -		 chatCreationInfo:[NSDictionary dictionaryWithObjectsAndKeys:
    1.23 -						   name, @"room",
    1.24 -						   server, @"server",
    1.25 -						   account.formattedUID, @"handle",
    1.26 -						   password, @"password", /* may be nil, so should be last */
    1.27 -						   nil]];
    1.28 +		[adium.chatController chatWithName:[NSString stringWithFormat:@"%@@%@", name, server]
    1.29 +								identifier:nil
    1.30 +								 onAccount:account
    1.31 +						  chatCreationInfo:[NSDictionary dictionaryWithObjectsAndKeys:
    1.32 +											name, @"room",
    1.33 +											server, @"server",
    1.34 +											account.formattedUID, @"handle",
    1.35 +											password, @"password", /* may be nil, so should be last */
    1.36 +											nil]];
    1.37  	} else {
    1.38  		NSBeep();
    1.39  	}