Adium

Changeset 12071

Show
Ignore:
Timestamp:
05/24/2005 05:54:59 AM (4 years ago)
Author:
evands
Message:

Oops, there's a bunch of untested code in [12069] which wasn't ready to be committed. Reverted [12069].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plugins/Gaim Service/ESGaimMSNAccount.m

    r12070 r12071  
    1717#import "AIAccountController.h" 
    1818#import "AIContactController.h" 
    19 #import "AIContentController.h" 
    2019#import "AIStatusController.h" 
    2120#import "ESGaimMSNAccount.h" 
     
    2827#import <Adium/AIStatus.h> 
    2928#import <Adium/ESFileTransfer.h> 
    30 #import <AIUtilities/AIStringAdditions.h> 
    3129 
    3230#define DEFAULT_MSN_PASSPORT_DOMAIN @"@hotmail.com" 
    3331 
    3432@interface ESGaimMSNAccount (PRIVATE) 
    35 - (void)updateFriendlyNameToServerFriendlyName; 
    3633-(void)_setFriendlyNameTo:(NSAttributedString *)inAlias; 
    3734@end 
     
    163160{ 
    164161        [super accountConnectionConnected]; 
    165          
    166         [self updateFriendlyNameToServerFriendlyName]; 
    167162        [self updateStatusForKey:@"FullNameAttr"]; 
    168163}        
     
    182177 
    183178/* 
    184  * @brief Update our friendly name to match the serer friendly name if appropriate 
    185  * 
    186  * Well behaved MSN clients respect the serverside display name so that an update on one client is reflected on another. 
    187  *  
    188  * If our display name is static, we should update to the serverside one if they aren't the same. 
    189  * 
    190  * However, if our display name is dynamic, most likely we're looking at the filtered version of our dynamic 
    191  * name, so we shouldn't update to the filtered one. 
    192  */ 
    193 - (void)updateFriendlyNameToServerFriendlyName 
    194 { 
    195         const char *displayName = gaim_connection_get_display_name(gaim_account_get_connection(account)); 
    196         if(displayName && 
    197            strcmp(displayName, [[self UID] UTF8String]) && 
    198            strcmp(displayName, [[self formattedUID] UTF8String])){ 
    199                 /* There is a serverside display name, and it's not the same as our UID. */ 
    200                 NSAttributedString      *ourPreference = [self autoRefreshingOriginalAttributedStringForStatusKey:@"FullNameAttr"]; 
    201  
    202                 if(strcmp([[ourPreference string] UTF8String], displayName)){ 
    203                         /* The display name is different from our preference. Check if our preference is static. */ 
    204                         NSAttributedString      *filteredValue; 
    205                          
    206                         filteredValue = [[adium contentController] filterAttributedString:ourPreference 
    207                                                                                                                           usingFilterType:AIFilterContent 
    208                                                                                                                                         direction:AIFilterOutgoing 
    209                                                                                                                                           context:self]; 
    210                          
    211                         if([[filteredValue string] isEqualToString:[ourPreference string]]){ 
    212                                 /* Filtering made no changes to the string, so we're static. If we make it here, update to match the server. */ 
    213                                 [self setPreference:[[[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:displayName]] autorelease] 
    214                                                          forKey:@"FullNameAttr" 
    215                                                           group:GROUP_ACCOUNT_STATUS]; 
    216                         } 
    217                 } 
    218         } 
    219 } 
    220  
    221 /* 
    222179 gaim_connection_get_display_name(gc) will get the current display name... which is stored serverside so 
    223180 reflects changes made on other clients or other systems.  do we want to use this somehow? 
     
    262219         */ 
    263220} 
     221 
    264222 
    265223#pragma mark File transfer 
     
    466424#pragma mark Account Action Menu Items 
    467425- (NSString *)titleForAccountActionMenuLabel:(const char *)label 
    468 {       
     426{ 
    469427        if(strcmp(label, "Set Friendly Name") == 0){ 
    470                 return [AILocalizedString(@"Set Display Name","Action menu item for setting the display name") stringByAppendingEllipsis]; 
    471  
    472         }else if(strcmp(label, "Set Home Phone Number") == 0){ 
    473                 return AILocalizedString(@"Set Home Phone Number",nil); 
    474                  
    475         }else if(strcmp(label, "Set Work Phone Number") == 0){ 
    476                 return AILocalizedString(@"Set Work Phone Number",nil); 
    477                  
    478         }else if(strcmp(label, "Set Mobile Phone Number") == 0){ 
    479                 return AILocalizedString(@"Set Mobile Phone Number",nil); 
    480                  
    481         }else if(strcmp(label, "Allow/Disallow Mobile Pages") == 0){ 
    482                 return AILocalizedString(@"Allow/Disallow Mobile Pages","Action menu item for MSN accounts to toggle whether Mobile pages [forwarding messages to a mobile device] are enabled"); 
     428                return(nil); 
    483429        } 
    484430