Simplify the "status message" contact/account property into one getter method. Correct error -1728 from AS on contact's status messages. Fixes #13460.
authorZachary West <zacw@adium.im>
Fri Nov 27 15:50:57 2009 -0500 (8 months ago)
changeset 28351e8c89f99dfe
parent 2834 e7db526620d1
child 2836 758f5a24e190
Simplify the "status message" contact/account property into one getter method. Correct error -1728 from AS on contact's status messages. Fixes #13460.

The totally undocumented -1728 error appears to be caused by runtime type disagreeing with event type. "status message" is apparently assumed to only have 1 code, so specifying one for contacts and one for accounts was confusing it when it was going to fetch it.
Frameworks/Adium Framework/Source/AIAccount.m
Frameworks/Adium Framework/Source/AIListContact.m
Frameworks/Adium Framework/Source/AIListObject.m
Resources/Adium.sdef
     1.1 --- a/Frameworks/Adium Framework/Source/AIAccount.m	Fri Nov 27 13:41:37 2009 -0500
     1.2 +++ b/Frameworks/Adium Framework/Source/AIAccount.m	Fri Nov 27 15:50:57 2009 -0500
     1.3 @@ -1208,14 +1208,6 @@
     1.4  }
     1.5  
     1.6  /**
     1.7 - * @brief Returns the current status message as rich text
     1.8 - */
     1.9 -- (NSTextStorage *)scriptingStatusMessage
    1.10 -{
    1.11 -	return [[[NSTextStorage alloc] initWithAttributedString:self.statusState.statusMessage] autorelease];
    1.12 -}
    1.13 -
    1.14 -/**
    1.15   * @brief Returns a mutable status
    1.16   *
    1.17   * If the current status is built in, we create a temporary copy of the current status and set that.
     2.1 --- a/Frameworks/Adium Framework/Source/AIListContact.m	Fri Nov 27 13:41:37 2009 -0500
     2.2 +++ b/Frameworks/Adium Framework/Source/AIListContact.m	Fri Nov 27 15:50:57 2009 -0500
     2.3 @@ -873,6 +873,7 @@
     2.4  		containerSpecifier:containerRef key:@"contacts" name:self.UID] autorelease];
     2.5  }
     2.6  
     2.7 +
     2.8  - (NSArray *)groupsAsArray
     2.9  {
    2.10  	return self.groups.allObjects;
     3.1 --- a/Frameworks/Adium Framework/Source/AIListObject.m	Fri Nov 27 13:41:37 2009 -0500
     3.2 +++ b/Frameworks/Adium Framework/Source/AIListObject.m	Fri Nov 27 15:50:57 2009 -0500
     3.3 @@ -602,16 +602,6 @@
     3.4  	}
     3.5  }
     3.6  
     3.7 -- (NSString *)scriptingStatusMessage
     3.8 -{
     3.9 -	return [self statusMessageString];
    3.10 -}
    3.11 -- (void)setScriptingStatusMessage:(NSString *)message
    3.12 -{
    3.13 -	[[NSScriptCommand currentCommand] setScriptErrorNumber:errOSACantAssign];
    3.14 -	[[NSScriptCommand currentCommand] setScriptErrorString:@"Can't set the status of a contact."];
    3.15 -}
    3.16 -
    3.17  - (void)setBaseAvailableStatusAndNotify:(NotifyTiming)notify
    3.18  {
    3.19  	[self setStatusWithName:nil
    3.20 @@ -826,6 +816,15 @@
    3.21  	}
    3.22  	return 0;
    3.23  }
    3.24 +
    3.25 +/**
    3.26 + * @brief Returns the current status message as rich text
    3.27 + */
    3.28 +- (NSTextStorage *)scriptingStatusMessage
    3.29 +{
    3.30 +	return [[[NSTextStorage alloc] initWithAttributedString:self.statusMessage] autorelease];
    3.31 +}
    3.32 +
    3.33  @end
    3.34  
    3.35  /*
     4.1 --- a/Resources/Adium.sdef	Fri Nov 27 13:41:37 2009 -0500
     4.2 +++ b/Resources/Adium.sdef	Fri Nov 27 15:50:57 2009 -0500
     4.3 @@ -227,7 +227,7 @@
     4.4  			<property name="status type" code="Psts" type="status types" access="r" description="The current status of this contact">
     4.5  				<cocoa key="scriptingStatusType" />
     4.6  			</property>
     4.7 -			<property name="status message" code="Psmg" type="rich text" access="r" description="The custom status message for this contact.">
     4.8 +			<property name="status message" code="Pasm" type="rich text" access="r" description="The custom status message for this contact.">
     4.9  				<cocoa key="scriptingStatusMessage" />
    4.10  			</property>
    4.11  			<property name="image" code="Pimg" type="TIFF picture" access="rw" description="The image associated with this contact.">