Page 1 of 1

Server Display Names

Posted: Fri May 06, 2005 11:31 am
by yadgor
Hey,

I know this question has been asked before, but I don't think it was understood properly.

The problem is when using Adium for MSN, the confusion between alias's and display names, etc.

What I wanted to do was have my contacts show as "Jim (this is my display name)". Where "Jim" is a local alias I have given that contact, and "this is my display name" is the serverside Display name for the MSN user.

I've put together a quick and dirty bit of code which does this (kind of) so you get the idea. Here are the diff's.

AIAliasSupportPlugin.h:

Code: Select all

25c25,26
<       AINameFormat_ScreenName
---
>       AINameFormat_ScreenName,
>       AINameFormat_DisplayName_ServerDisplayName
AIAliasSupportPlugin.m:

Code: Select all

36a37
> #define ALIAS_SERVERDISPLAYNAME               AILocalizedString(@"Alias (Server Display Name)",nil)
206a208
>       NSString                        *serverDisplayName = nil;
209a212
> 
249a253,263
>                       case AINameFormat_DisplayName_ServerDisplayName:
> 
>                               serverDisplayName = [inObject statusObjectForKey:@"Server Display Name"];
>                               if(!displayName || !serverDisplayName || [displayName isEqualToString:serverDisplayName]){
>                                       longDisplayName = displayName;
>                               }else{
>                                       longDisplayName = [NSString stringWithFormat:@"%@ (%@)",displayName,serverDisplayName];
>                               }
>                                       break;
> 
> 
311a326,332
>       menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ALIAS_SERVERDISPLAYNAME
>                                                                               target:self
>                                                                               action:@selector(changeFormat:)
>                                                                                keyEquivalent:@""] autorelease];
>     [menuItem setTag:AINameFormat_DisplayName_ServerDisplayName];
>     [choicesMenu addItem:menuItem];
>     
This is the basic idea, but you have to reselect it in "Contact Name Format" each time, and when contacts come online you need to select it again for them to change.

Im sure these things are easily fixed I'm just too lazy to do it.

The MSN user's would appreciate this option.

Another suggestion is instead of having a "Contact Name Format", let the user create there own. So when you set an alias, you could have "Jim - %_email, %_screenname, %_serverdisplayname" etc. You could set default one for all other contacts.

Hope all that makes sense to someone, if not just ignore it all and I'll continue on my way :)

Posted: Fri May 06, 2005 12:54 pm
by michael

Posted: Fri May 06, 2005 1:12 pm
by yadgor
michael wrote:Wont this do the job? http://forums.cocoaforge.com/viewtopic. ... 1660#21660
It wont work for me because im using the "Contact Bubbles (To Fit)" window style so the option is shaded out.