quote:
Originally posted by deAd
Cookie, that is just a check, and is not required. The same result will be produced if you do not add that if statement. Plus will not send the message if it can't.
That is not 'just' a check, it is actually very required as it is not always possible to send a message to a chat window (even if you just opened it).
quote:
Originally posted by saralk
I feel like an idiot now. My code is nothing like what you actually wanted
don't be, he first asked how to send a message to all online contacts which you indeed provided.
quote:
Originally posted by 134jimbodude
So to put more emails in would i just do:
code:
function OnEvent_Signin(sUserEmail){
var sEmail = "email@address.com;email@adress2.com";
var oContact = Messenger.MyContacts.GetContact(sEmail);
if(oContact.Status != 1){
var ChatWnd = Messenger.OpenChat(sEmail);
ChatWnd.SendMessage("hi");
}
}
no, absolutely not...
the variable
sEmail is a string, it will be compared literally to the string which holds the email of the current contact object. Or in this specific code it will be passed to the GetContact function as the email to find.
"email@address.com;email@adress2.com" is not a valid email address and thus this will never work.
What you want is checking the email of the current contact object against a list or in other words against an array...
PS: make up your mind though, each time you request something different, which requires different code