Add a "groups" property to contacts, removing the "group" property. Fixes #12822.
authorZachary West <zacw@adium.im>
Fri Nov 27 13:41:37 2009 -0500 (2009-11-27)
changeset 2834e7db526620d1
parent 2833 fbb560e54233
child 2835 1e8c89f99dfe
Add a "groups" property to contacts, removing the "group" property. Fixes #12822.

AppleScript appears to not use KVC things, so "cocoa key = groups.allObjects" doesn't work, so a helper method was necessary. Lame.
Frameworks/Adium Framework/Source/AIListContact.m
Resources/Adium.sdef
     1.1 --- a/Frameworks/Adium Framework/Source/AIListContact.m	Fri Nov 27 13:16:32 2009 -0500
     1.2 +++ b/Frameworks/Adium Framework/Source/AIListContact.m	Fri Nov 27 13:41:37 2009 -0500
     1.3 @@ -873,6 +873,11 @@
     1.4  		containerSpecifier:containerRef key:@"contacts" name:self.UID] autorelease];
     1.5  }
     1.6  
     1.7 +- (NSArray *)groupsAsArray
     1.8 +{
     1.9 +	return self.groups.allObjects;
    1.10 +}
    1.11 +
    1.12  - (BOOL)scriptingBlocked
    1.13  {
    1.14  	return [self isBlocked];
     2.1 --- a/Resources/Adium.sdef	Fri Nov 27 13:16:32 2009 -0500
     2.2 +++ b/Resources/Adium.sdef	Fri Nov 27 13:41:37 2009 -0500
     2.3 @@ -212,8 +212,8 @@
     2.4  		<class name="contact" code="Ccnt" description="A contact">
     2.5  			<cocoa class="AIListContact" />
     2.6  			<property name="account" code="Cact" type="account" access="r" description="The account associated with this contact" />
     2.7 -			<property name="group" code="Pgrp" type="contact group" access="r" description="The group associated with this contact">
     2.8 -				<cocoa key="parentGroup" />
     2.9 +			<property name="groups" code="Pgrp" type="list of contact group" access="r" description="The groups associated with this contact">
    2.10 +				<cocoa key="groupsAsArray" />
    2.11  			</property>
    2.12  			<property name="name" code="pnam" type="text" access="r" description="The name of this contact">
    2.13  				<cocoa key="UID" />