PS: code loop blocks like
code:
var i;
i = new Enumerator( Contacts );
while( !i.atEnd() ) {
var Contact = i.item();
if( Contact.Email == Arg ) {
return Contact.Email;
}
i.moveNext();
}
can be made much shorter like so:
code:
for (var i = new Enumerator(Contacts); !i.atEnd(); i.moveNext()) {
var Contact = i.item();
if (Contact.Email === Arg) return Contact.Email;
}
or
code:
var i = new Enumerator(Contacts);
for (; !i.atEnd(); i.moveNext()) {
var Contact = i.item();
if (Contact.Email === Arg) return Contact.Email;
}
in case you need to go thru the enumeration a couple of times like in the GetContactEmail procedure.
------------
And to prevent possible screwups when a user signs out and signs back in with another Windows Live Id: If you use timers, always make sure the ID of the timer is unique to the user's email.
This means that a hardcoded name (like 'restorename') can conflict with the previous running timer from the user who was signed in before. So, better make that name something like 'restorename' + Messenger.MyEmail
Or kill all timers as soon as the user signs out.