NanaFreak
Scripting Contest Winner
Posts: 1476 Reputation: 53
32 / /
Joined: Jul 2006
|
RE: [?] retrieve contact status
code: var PluginObj;
Status = new Array('Unknown', 'Offline', 'Unknown', 'Online', 'Busy', 'Be Right Back', 'Idle', 'Away', 'In a Call', 'Out to Lunch');
function OnEvent_Initialize(MessengerStart)
{
if ( PluginObj == null )
{
OnEvent_Signin(Messenger.MyEmail);
}
}
function OnEvent_Uninitialize(MessengerExit)
{
PluginObj = null;
}
function SetWindowText(hWnd, sText)
{
Interop.Call('user32', 'SetWindowTextW', hWnd, sText);
}
function OnWndOpenedEvent_EditTextChanged(PlusWnd,ControlId)
{
if ( PlusWnd.GetControlText(ControlId) != "" )
{
var Contacts = Messenger.MyContacts;
var Contact = Contacts.GetContact(PlusWnd.GetControlText(ControlId));
if ( Contact == null )
{
MsgPlus.DisplayToast("Window Opened", PlusWnd.GetControlText(ControlId) + " has opened a conversation with you.", "", "ToastCallback", PlusWnd.GetControlText(ControlId));
}
else
{
MsgPlus.DisplayToast("Window Opened", Contact.Name + "("+Status[Contact.Status]+ ")" + " has opened a conversation with you.", "", "ToastCallback", Contact.Email);
}
PlusWnd.SetControlText(ControlId, "");
}
}
function ToastCallback(Param)
{
Messenger.OpenChat(Param);
}
function LoadPlugin_VB(ProgId, CurrentEmail, OpenTextControlhWnd)
{
PluginObj = new ActiveXObject(ProgId);
if(PluginObj)
{
if(PluginObj.Initialize(8, CurrentEmail + "|" + OpenTextControlhWnd, undefined) == false)
{
MsgPlus.DisplayToast("Open Notifier", "Notifier was unable to load for an unknown reason");
}
}
}
function OnEvent_Signin(Email)
{
var pOpenWindow = MsgPlus.CreateWnd("Opened.xml","WndOpened",1);
SetWindowText(pOpenWindow.Handle, Email + "MSGPLNOTIFOPEN");
LoadPlugin_VB("MSNWON.WindowNotifier", Email, pOpenWindow.GetControlHandle("Edt1"), 0);
}
function OnEvent_Signout(Email)
{
PluginObj = null;
}
fixed it for you
|
|