Adium

Ticket #13460 (closed enhancement: fixed)

Opened 4 months ago

Last modified 3 months ago

AppleScript an getting the status message of a contact

Reported by: assetburned Owned by: applmak
Milestone: Adium 1.4 Component: AppleScript
Version: 1.4b15 Severity: normal
Keywords: Cc:
Patch Status:

Description

I was wondering why exactly it is possible to get the status type of a contact (onnline, invisible...) but not the status message.

If I try for example this script

tell application "Adium"
	set Suserlist to name of (every contact whose status type is not offline)
	repeat with AnItem from 1 to (count Suserlist)
		set Sstatus to status type of (first contact whose name is (item AnItem of Suserlist)) as string
		if Sstatus is "available" then
			display dialog ((item AnItem of Suserlist) & " is available")
			-- do something
		else if Sstatus is "away" then
			display dialog ((item AnItem of Suserlist) & " is away")
			-- do something
		else if Sstatus is "invisible" then
			display dialog ((item AnItem of Suserlist) & " is invisible")
			-- do something
		end if
	end repeat
end tell

I get a popup for every contact with the status, but if I add this line (inside of the repeat) the script editor tells me it wouldn't be possible to get the status message.

set Sstatusmessage to status message of (first contact whose name is (item AnItem of Suserlist))

If that is wrong then what is the correct way to address this information and why should it be different from addressing the status type?

Change History

Changed 3 months ago by jas8522

  • milestone set to Adium 1.4.x

I think this has been like this since 1.3, so not a regression.

Changed 3 months ago by Zachary West <zacw@…>

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

(In  1e8c89f99dfe) 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.

Changed 3 months ago by zacw

  • milestone changed from Adium 1.4.x to Adium 1.4

Changed 3 months ago by Zachary West <zacw@…>

(In  758f5a24e190) Fix more "status message" type confusion. Fixes #11491. Refs #13460.

Changed 3 months ago by assetburned

Ok so this might be fixed, but how is it done?

sorry that I ask it here, but if someone use google to find something about it... then he should also find a solution for it here. and I'm also interested in it. ;-)

Note: See TracTickets for help on using tickets.