adium-1.4 2865:6ad1d654769a: Include the alias in the authorizat...
commits at adium.im
commits at adium.im
Wed Dec 2 01:47:17 UTC 2009
details: http://hg.adium.im/adium-1.4/rev/6ad1d654769a
revision: 2865:6ad1d654769a
author: Zachary West <zacw at adium.im>
date: Tue Dec 01 20:47:11 2009 -0500
Include the alias in the authorization window. Only include the account details if there's more than one account of that type.
diffs (55 lines):
diff -r 741771960349 -r 6ad1d654769a Frameworks/Adium Framework/Source/AIAuthorizationRequestsWindowController.m
--- a/Frameworks/Adium Framework/Source/AIAuthorizationRequestsWindowController.m Tue Dec 01 18:44:04 2009 -0500
+++ b/Frameworks/Adium Framework/Source/AIAuthorizationRequestsWindowController.m Tue Dec 01 20:47:11 2009 -0500
@@ -13,6 +13,7 @@
#import <Adium/AIServiceIcons.h>
#import <Adium/AIContactControllerProtocol.h>
#import <Adium/AIListContact.h>
+#import <Adium/AIAccountControllerProtocol.h>
#import <AIUtilities/AIMenuAdditions.h>
#import <AIUtilities/AIImageTextCell.h>
#import <AIUtilities/AIImageAdditions.h>
@@ -490,9 +491,29 @@
type:AIServiceIconLarge
direction:AIIconNormal] imageByScalingToSize:NSMakeSize(MINIMUM_ROW_HEIGHT-2, MINIMUM_ROW_HEIGHT-2)];
} else if ([identifier isEqualToString:@"request"]) {
- return [NSString stringWithFormat:AILocalizedString(@"%@ on the account %@", nil),
- [[requests objectAtIndex:rowIndex] objectForKey:@"Remote Name"],
- ((AIAccount *)[[requests objectAtIndex:rowIndex] objectForKey:@"Account"]).explicitFormattedUID];
+ AIAccount *account = [[requests objectAtIndex:rowIndex] objectForKey:@"Account"];
+ NSString *displayName = [[requests objectAtIndex:rowIndex] objectForKey:@"Alias"];
+ NSString *UID = [[requests objectAtIndex:rowIndex] objectForKey:@"Remote Name"];
+ NSString *finalDisplay = nil;
+
+ if (displayName && UID) {
+ finalDisplay = [NSString stringWithFormat:@"%@ (%@)", displayName, UID];
+ } else if (displayName) {
+ finalDisplay = displayName;
+ } else { // if (UID) {
+ finalDisplay = UID;
+ }
+
+ NSArray *accounts = [adium.accountController accountsCompatibleWithService:account.service];
+
+ if (accounts.count > 1) {
+ // Only show the account if it's the only one of its type.
+ return [NSString stringWithFormat:AILocalizedString(@"%@ on the account %@", nil),
+ finalDisplay,
+ ((AIAccount *)[[requests objectAtIndex:rowIndex] objectForKey:@"Account"]).explicitFormattedUID];
+ } else {
+ return finalDisplay;
+ }
}
return nil;
diff -r 741771960349 -r 6ad1d654769a Plugins/Purple Service/adiumPurpleAccounts.m
--- a/Plugins/Purple Service/adiumPurpleAccounts.m Tue Dec 01 18:44:04 2009 -0500
+++ b/Plugins/Purple Service/adiumPurpleAccounts.m Tue Dec 01 20:47:11 2009 -0500
@@ -58,6 +58,7 @@
nil];
if (message && strlen(message)) [infoDict setObject:[NSString stringWithUTF8String:message] forKey:@"Reason"];
+ if (alias && strlen(alias)) [infoDict setObject:[NSString stringWithUTF8String:alias] forKey:@"Alias"];
//Note that CBPurpleAccount will retain ownership of this object to keep it around for us in case adiumPurpleAccountRequestClose() is called.
return [accountLookup(account) authorizationRequestWithDict:infoDict];
More information about the commits
mailing list