[Adium-devl] Calling -formattedUID on AIMetacontact returns nil

Augie Fackler lists at durin42.com
Wed Feb 6 16:21:12 UTC 2008


On Feb 6, 2008, at 9:54 AM, George Armah wrote:

> Hello Adium-devs,
> as the subject of the email and the following comment from
> AIMetaContact.m indicate ,
> for a metaContact, "//FormattedUID will return nil if we have multiple
> different UIDs contained within us".
>
> This is causing a window to fail to display in my plugin if a user
> selects a metaContact.
> I wanted to know if there was any special reason for the above  
> behavior.

My guess: so that code asking for formattedUIDs will fail if it gets a  
meta. Honestly, I think it might be wiser for us to raise an exception  
in AIMetaContact's -formattedUID. Then again, I'm a lunatic.

> If not would any of the following behaviors be acceptable ?:
>
> Return the formttedUID's associated with the primary service or
> preferredContact for the MetaContact
> (the one that is displayed in the contact list window)
> or
> Return an NSArray of NSStrings containing the formattedUID's for the
> listContacts contained in that
> metaContact.

The problem with these solutions (as I see it) is that -formattedUID  
only really has meaning on a service, and without the service  
information a formattedUID just looks pretty.
Why not just check for nil and if you got nil just do [[meta  
preferredContact] formattedUID]?

Peace,
Augie





More information about the devel mailing list