Hi Dpcris85

I saw you changed the position of that event, but now it's called also when an user didn't change his/her DP (for example everytime we join in a conversation). It's not so good. I think the best solution would be to re-put it in cmsn_change_state but at the end of "if { $oldPic != $newPic } {"
What do you think about?
Thanks, bye.
Hi square87,
the reason I didn't put the event in cmsn_change_state is because if the config key "lazypicretrieval" is set to false, the new display picture retrieval is not immediately executed, but is delayed, through the use of the ChatQueue procedure (protocol.tcl, 5010-5013)
Because of this, if we fire the event inside the cmsn_change_state procedure, there is the possibility that the event is handled by plugins
before the picture is retrieved, and in this case plugins will operate on the old display picture.
About the "event fired when user didn't change his DP", I did some testing to make sure that the event was fired only when appropriate, but maybe I missed something. I'm going to do a little more testing; I will update the post ASAP.
EDIT: After some testing, it seems to me that the issue rises only when the contact is using a default aMSN display picture (or better, a display picture that for some reason is not inside the display picture cache). Can you confirm this? Anyway, if this is correct, then the problem is in the second point of the procedure in which the event is fired (msnp2p.tcl:197). Unfortunately I can't find a way to detect if the display picture changed in a less "hacky" way than the one of the following code:
} else {
set old_file ""
catch {set old_file [displaypicture_std_$user cget -file]}
::skin::getDisplayPicture $user 1
set new_file [displaypicture_std_$user cget -file]
if {$new_file != $old_file} {
# launch an event for plugins
set evPar(user) $user
::plugins::PostEvent ChangeDP evPar
}
}
Please let me know if the results of my tests are consistent with yours.