There have been numerous topics about an "OnEvent_DPChanged" function. There is currently a known solution:
JScript code:
var DP = ""; // Global variable specifying the user's DP
var Started = false; // Just a small check variable
var Time = 60000; // 1 minute
function OnEvent_Initialize(bool) {
if(Messenger.MyStatus > 0) {
// Assign DP the current picture
DP = Messenger.MyDisplayPicture;
// No need to do it twice
Started = true;
// Add the timer so we can check in one minute
MsgPlus.AddTimer("TmrCheckDP" + Messenger.MyUserId,Time);
}
}
// If Started is false, we'll call the Initialise function again
function OnEvent_SigninReady(Email) {
if(!Started) OnEvent_Initialize(false);
}
function OnEvent_Timer(ID) {
switch(ID) {
case "TmrCheckDP" + Messenger.MyUserId:
if(DP !== Messenger.MyDisplayPicture) {
// Callback function
OnEvent_MyDPChange(DP);
// Re-assign DP
DP = Messenger.MyDisplayPicture;
// Re-add the timer so we can keep checking
MsgPlus.AddTimer(ID,Time);
return true;
}
return false;
}
function OnEvent_MyDPChange(OldDP) {
// Do what you want to do here; e.g. delete the OldDP;
// The 'new' DP can be accessed through Messenger.MyDisplayPicture
}