I'm not an expert plugin developer, but iirc, there IS already a 
"contactlistLoaded" event... but note that the 
states of the users at login is not known, they all appear as if they just 
logged in after we login... the way 
we receive it in the protocol is a bit different so we know it's their "initial 
state" but it still appears as 
if they connected randomly, so we have no way to know if we received all those 
"initial logins" or if their 
still are some.. you could add a timer after the OnConnect, let's say 5 
seconds, then on every 
ContactStateChanged you receive, reset the time (after cancel ... after 5000 
...), this way you're sure to 
execute your code 5 seconds after the last user loggs in initially...
this might be a solution, I see no other one...

KKRT

On Sat, Dec 23, 2006 at 04:56:43PM -0800, Kemal Eroglu wrote:
> 
>    Hi,
> 
>    Thank you for your reply. My problem is this: I need to get a list of 
> offline users right after the user logs in. I tried to do it in the 
> following way: Upon receiving the OnConnect signal, execute
> 
>    set conlist [::abook::getAllContacts]
> 
>    foreach user $conlist {
> 
>       set userstate [::abook::getVolatileData $user state]
>       if { $userstate != "" && $userstate != "FLN" && some other stuff} {
> 
>               code
> 
>       }
>     }
> 
>    But this didn't work since $userstate is (yet) the empty string for all 
> contacts. If I wait for 4 seconds however I can read the correct values 
> ("FLN" etc.).
> 
>    I just re-checked the plugin developers' guide page
> 
>    
> http://amsn.sourceforge.net/devwiki/tiki-index.php?page=Plugin+developer+Guide
> 
>    but I'm not sure which post event would do the job you mention above -- 
> that is send notification for each user. Did you mean to say that I should 
> directly read it from the protocol messages? If so, I can try that, but I 
> still think that a protocol-independent way would be nice (hence, adding 
> an event like contactlistReady). Also, if I want to read protocol 
> messages, wouldn't I have to register to receive every protocol message? 
> What I need are the messages at the beginning only.
> 
>    Thanks,
> 
>    Ilgar
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to