adium-1.4 2946:3b966aae21c8: Patch to fix IRC tab completion wit...

commits at adium.im commits at adium.im
Thu May 13 01:43:49 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/3b966aae21c8
revision:	2946:3b966aae21c8
author:		alangh
date:		Wed May 12 19:42:47 2010 -0600

Patch to fix IRC tab completion with aliased names.  Fixes #12728.  Thanks mlei.

diffs (23 lines):

diff -r 7eed15863815 -r 3b966aae21c8 Plugins/Dual Window Interface/AIMessageViewController.m
--- a/Plugins/Dual Window Interface/AIMessageViewController.m	Wed May 12 12:36:43 2010 -0500
+++ b/Plugins/Dual Window Interface/AIMessageViewController.m	Wed May 12 19:42:47 2010 -0600
@@ -1058,10 +1058,16 @@
 		completions = [NSMutableArray array];
 		
 		for (AIListContact *listContact in [self contactsMatchingBeginningString:partialWord]) {
-			NSString *displayName = [self.chat aliasForContact:listContact];
+			// For each matching contact: if chatShouldAutoCompleteUID, then return the formattedUID
+			// else return the displayName
+			NSString *displayName = autoCompleteUID ? listContact.formattedUID : listContact.displayName;
 			
-			if (!displayName)
-				displayName = autoCompleteUID ? listContact.formattedUID : listContact.displayName;
+			// Check the alias. If it's the same as the UID or displayName except for case, use the alias
+			// (Since it probably is mixed case)
+			NSString *alias = [self.chat aliasForContact:listContact];
+			if ([alias caseInsensitiveCompare:displayName] == NSOrderedSame) {
+				displayName = alias;
+			}
 			
 			[completions addObject:(suffix ? [displayName stringByAppendingString:suffix] : displayName)];
 		}




More information about the commits mailing list