hmmm do you have the syntax for switch?
I made few changes about handling the PSM... if you have any ideas how to improve it...
code:
var PreviousToTimerPSM;
var mDate = new Date();
function OnEvent_Signout(Email) {
Messenger.MyPersonalMessage = PreviousToTimerPSM; //restores the original PSM while signing
out?
}
function OnEvent_SigninReady(Email) {
Messenger.MyPersonalMessage = ""; //retrieves the previous PSM once the user is signed in?
}
function OnEvent_MyStatusChange(NewStatus) {
if( NewStatus == 3 ) {
Messenger.MyPersonalMessage = ""; //if it's online, no need to count.
} else if( NewStatus == 6 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ausente desde
"+mDate.getHours()+":"+mDate.getMinutes();
} else if( NewStatus == 4 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ocupado desde
"+mDate.getHours()+":"+mDate.getMinutes();
} else if( NewStatus == 5 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Saí às "+mDate.getHours()+":"+mDate.getMinutes()+" mas
volto logo!";
} else if( NewStatus == 7 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ausente desde
"+mDate.getHours()+":"+mDate.getMinutes();
} else if( NewStatus == 8 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou em uma ligação desde
"+mDate.getHours()+":"+mDate.getMinutes();
} else if( NewStatus == 9 ) {
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou almoçando desde
"+mDate.getHours()+":"+mDate.getMinutes();
}
}