Adium

Ticket #10118 (closed defect: fixed)

Opened 3 months ago

Last modified 2 months ago

Applescript Set Status Message Broken

Reported by: Mikooster Assigned to: applmak
Priority: normal Milestone: SVN issues
Component: AppleScript Version: 1.3b3
Severity: regression Keywords: applescript status message
Cc: Patch: Accepted
Pending: 0

Description

The applescript

tell application "Adium"
           set the status message of every account to "Something"
end tell

fails with error "Can't set the status of a contact."

Attachments

adium-fix.diff (0.8 kB) - added by jorj on 07/02/2008 03:07:34 AM.
simple patch

Change History

06/15/2008 02:21:58 PM changed by applmak

  • status changed from new to closed.
  • resolution set to fixed.

(In [23991]) In what may be the most amount of time spent on debugging a problem with an obvious solution, I have changed the various status properties to be rw, rather than just r. 10.4 completely ignores this flag, but 10.5 respects it. Fixes #8809. Fixes #10118.

06/30/2008 12:23:35 PM changed by Robby

  • status changed from closed to reopened.
  • resolution deleted.
  • severity changed from normal to regression.
  • milestone set to Adium X 1.3.

According to #10261 this is not fixed.

07/02/2008 03:06:49 AM changed by jorj

This is because AIAccount.m has this:

- (void)setScriptingStatusMessageWithAttributedString:(NSString *)message

where its superclass (AIContact) has this:

- (void)setScriptingStatusMessage:(NSString *)message

AppleScript appears unable to create rich text, thus calls the latter, which falls through to the wrong class.

I'll attach a simple patch - just implement setScriptingStatusMessage:. Someone with more knowledge of the guts should vet this for correctness; all that I can attest to is that it functions.

07/02/2008 03:07:34 AM changed by jorj

  • attachment adium-fix.diff added.

simple patch

07/16/2008 08:04:53 PM changed by applmak

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [24387]) Fixed a bug in setting the message of an existing status. Closes #10118.

This is a patch from jorj. Thank you!

07/16/2008 08:10:15 PM changed by Robby

  • patch_status changed from None to Accepted.

07/16/2008 08:10:36 PM changed by Robby

  • milestone changed from Adium X 1.3 to SVN issues.

07/17/2008 12:03:19 AM changed by evands

What's up with that method have a name ending in WithAttributedString but taking an NSString as its argument?

07/17/2008 08:05:23 AM changed by applmak

Because of the way that AS works, I can't be sure if the object passed in is an NSString (plain text) or some NSAttributedString subclass (like NSTextStorage). So, I statically type based on the superclass, and a short if-then tells me which subclass I need to worry about in setScriptingStatusMessageWithAttributedString.

07/17/2008 10:31:13 AM changed by evands

(In [24396]) Fixed -[AIAccount setScriptingStatusMessageWithAttributedString:]'s method signature to match the expected paramters. Refs #10118