Adium

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#9673 closed defect (fixed)

Applescript "get every contact whose status type is not offline" does not update

Reported by: meikura Owned by: applmak
Milestone: Adium 1.3 Component: AppleScript
Version: 1.2.5b1 Severity: normal
Keywords: AppleScript Cc:
Patch Status:

Description

(note: I have only tested the MSN network).
The command "get every contact whose status type is not offline" does not update for when people sign off. For example, Contact 1 and Contact 2 may be online when the script is run (thus outputting Contact 1 and 2).
Then Contact 1 signs off, leaving only Contact 2. If the script is re-run, it still outputs that Contact 1 and 2 are available.

This cannot be updated to show the true contacts online without disconnecting from the MSN network then reconnecting (which is incredibly inconvenient).

Change History (13)

comment:1 Changed 6 years ago by applmak

  • Milestone set to Needs feedback from users
  • pending changed from 0 to 1

Does your script tell the account to go offline? If so, does this bug still happen if you insert a 'delay' command? The problem may be that an account takes a little bit to disconnect, so if you ask for the contacts straightaway after disconnecting, you'll still get the same list of contacts.

comment:2 Changed 6 years ago by meikura

  • pending changed from 1 to 0

As far as I am aware, it does not update at all without disconnecting. I'll post up a simple AppleScript and you can see it for yourself:

tell application "Adium"

set userlist to every contact whose status type is not offline

end tell

return userlist

Try running this as people log off and you should see that the list does not update to show people who have just disconnected. I have also tried it after waiting for a few minutes and this does not solve it.

comment:3 Changed 6 years ago by applmak

Try this:

tell application "Adium"
	go online
	repeat until (get every account whose status type is offline) is {}
		delay 1
	end repeat
	set userlist to every contact whose status type is not offline
end tell

comment:4 Changed 6 years ago by applmak

And then tell me if that solves the problem. If it does, then this ticket is really asking for what #9685 is asking for, and I'll mark this one as a duplicate of that one. If not, there there's a trickier bug at stake here.

comment:5 Changed 6 years ago by djmori

comment:6 Changed 6 years ago by Robby

  • pending changed from 0 to 1

comment:1 Changed 6 years ago by trac-robot

  • pending changed from 1 to 0
  • Status changed from new to closed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

comment:2 Changed 6 years ago by apasechnik

The code you suggested does not help. even adding a "go offline" beforehand does not fix the problem. the contact list just grows and grows, or so it would appear. it does not update after an offline to online transition, nor after an application restart. i am trying to get this to work on an aim account, where i'm tracking the number of people that are online at any given time.

comment:3 Changed 6 years ago by Robby

  • Status changed from closed to reopened

comment:4 Changed 6 years ago by Robby

  • Milestone changed from Needs feedback from users to Adium X 1.3.x

comment:5 Changed 6 years ago by applmak

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [24281]) Rewrote the logic of this method to more accurately, and clearly portray what I believe was intended.
If we are offline, we should ALWAYS return AIOfflineStatusType. If we're online, we'll check the StatusType property to see the currently set status.
This fixes a bug that manifested itself in the AppleScript. Closes #9673.

DISCLAIMER: This changes a commonly used method, and though I did use Adium for a while after changing the method logic, and though I found no abnormal behavior, this change could cause other parts of the code to go wonky.

comment:12 Changed 6 years ago by applmak

  • Milestone changed from Adium X 1.3.x to Adium X 1.3

Hey, you're very much not crazy! Thanks for giving me good feedback. It really helped to find the problem!

comment:13 Changed 5 years ago by assetburned

hm just tried this code

tell application "Adium"
	get display name of every contact whose status type is not offline
end tell

And it looks like it is solved in 1.4b15

Note: See TracTickets for help on using tickets.