adium 3192:ce94db22c35a: Patch to fix IRC tab completion with al...
commits at adium.im
commits at adium.im
Thu May 13 01:58:53 UTC 2010
details: http://hg.adium.im/adium/rev/ce94db22c35a
revision: 3192:ce94db22c35a
author: alangh
date: Wed May 12 19:58:44 2010 -0600
Patch to fix IRC tab completion with aliased names. Fixes #12728. Thanks mlei.
diffs (23 lines):
diff -r 41a9e7637f5b -r ce94db22c35a 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:58:44 2010 -0600
@@ -1062,10 +1062,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