I don't think it's possibe to block people when signing out, cause the contact list is unavailable when the Signout Event occurs.
EDIT:
It is however possible to block everyone that is offline on signin, then after they come online, they are unblocked...
EDIT2: Added an unblocking routine of blocked persons that are online on signin.
But btw, this will also unblock blocked persons that are blocked for a reason (being annoying whatever)...
So maybe it should save in registry which persons are blocked by the script so that other blocked persons stay blocked??
code:
function OnEvent_ContactSignout(Email)
{
var Contacts = Messenger.MyContacts;
var Contact = Contacts.GetContact(Email);
if (Contact.Blocked == false)
{
Contact.Blocked = true;
}
}
function OnEvent_ContactSignin(Email)
{
var Contacts = Messenger.MyContacts;
var Contact = Contacts.GetContact(Email);
if (Contact.Blocked)
{
Contact.Blocked = false;
}
}
function OnEvent_SigninReady(Email)
{
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
if (Contact.Status == 1)
{
if (Contact.Blocked == false)
{
Contact.Blocked = true;
}
}
else
{
if (Contact.Blocked)
{
Contact.Blocked = false;
}
}
}
}