quote:
Originally posted by Spunky
you can copy a function to get the text from the toast and check if it says "X has sent you a message". Once you have received that and closed it, add the user into an array.
That wont work... You can have a window in focus which already has a conversation going on.
What you must do (and this is way less complicated; you also don't need any global array at all):
When a toast pops up, check the text of the toast and get the contact's email/name from it. If that email/name is the same as one of the emails/names in the current infocus* chat then hide the toast, if not, let the toast show.
* infocus: meaning all the chat windows (plural!) which are open, thus not minimized when tabbed chatting is disabled. Or the visible chat window (singular) when tabbed chatting is enabled.
PS: Depending on your computer speed it might well be that the toast which needs to be hidden will quite possible still show. This because getting the email/name from it, getting the contacts from the current infocus chats, comparing the two, etc all takes time. And it might well be that by that time the toast is already (partially) displayed.