| 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 | | /* |
|---|
| 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); |
|---|