adium 2985:a2e4af198865: Simplify the "status message" contact/a...
commits at adium.im
commits at adium.im
Fri Nov 27 20:51:36 UTC 2009
details: http://hg.adium.im/adium/rev/a2e4af198865
revision: 2985:a2e4af198865
author: Zachary West <zacw at adium.im>
date: Fri Nov 27 15:50:57 2009 -0500
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.
(transplanted from 1e8c89f99dfe50c2406a7552a8a90bae142677e0)
diffs (66 lines):
diff -r 3f96d6715a17 -r a2e4af198865 Frameworks/Adium Framework/Source/AIAccount.m
--- a/Frameworks/Adium Framework/Source/AIAccount.m Fri Nov 27 13:16:32 2009 -0500
+++ b/Frameworks/Adium Framework/Source/AIAccount.m Fri Nov 27 15:50:57 2009 -0500
@@ -1208,14 +1208,6 @@
}
/**
- * @brief Returns the current status message as rich text
- */
-- (NSTextStorage *)scriptingStatusMessage
-{
- return [[[NSTextStorage alloc] initWithAttributedString:self.statusState.statusMessage] autorelease];
-}
-
-/**
* @brief Returns a mutable status
*
* If the current status is built in, we create a temporary copy of the current status and set that.
diff -r 3f96d6715a17 -r a2e4af198865 Frameworks/Adium Framework/Source/AIListObject.m
--- a/Frameworks/Adium Framework/Source/AIListObject.m Fri Nov 27 13:16:32 2009 -0500
+++ b/Frameworks/Adium Framework/Source/AIListObject.m Fri Nov 27 15:50:57 2009 -0500
@@ -604,16 +604,6 @@
}
}
-- (NSString *)scriptingStatusMessage
-{
- return [self statusMessageString];
-}
-- (void)setScriptingStatusMessage:(NSString *)message
-{
- [[NSScriptCommand currentCommand] setScriptErrorNumber:errOSACantAssign];
- [[NSScriptCommand currentCommand] setScriptErrorString:@"Can't set the status of a contact."];
-}
-
- (void)setBaseAvailableStatusAndNotify:(NotifyTiming)notify
{
[self setStatusWithName:nil
@@ -828,6 +818,15 @@
}
return 0;
}
+
+/**
+ * @brief Returns the current status message as rich text
+ */
+- (NSTextStorage *)scriptingStatusMessage
+{
+ return [[[NSTextStorage alloc] initWithAttributedString:self.statusMessage] autorelease];
+}
+
@end
/*
diff -r 3f96d6715a17 -r a2e4af198865 Resources/Adium.sdef
--- a/Resources/Adium.sdef Fri Nov 27 13:16:32 2009 -0500
+++ b/Resources/Adium.sdef Fri Nov 27 15:50:57 2009 -0500
@@ -227,7 +227,7 @@
<property name="status type" code="Psts" type="status types" access="r" description="The current status of this contact">
<cocoa key="scriptingStatusType" />
</property>
- <property name="status message" code="Psmg" type="rich text" access="r" description="The custom status message for this contact.">
+ <property name="status message" code="Pasm" type="rich text" access="r" description="The custom status message for this contact.">
<cocoa key="scriptingStatusMessage" />
</property>
<property name="image" code="Pimg" type="TIFF picture" access="rw" description="The image associated with this contact.">
More information about the commits
mailing list