What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » OnEvent_ContactSignIn triggered twice...?

OnEvent_ContactSignIn triggered twice...?
Author: Message:
DeBiese
New Member
*


Posts: 4
42 / Male / –
Joined: Aug 2006
O.P. RE: OnEvent_ContactSignIn triggered twice...?
code:
function sendMessageWhenRequired(myMessage, Email)
{
    if (myMessage.length > 0)
    {
        //Check if my status requires sending a message
        var myStatus = Messenger.MyStatus;
        var sendStatus = myMessage[3].split(";");
        for (var i=0; i<sendStatus.length; i++)
        {
            var eSendStatus = getStatusEnum(sendStatus[ i]);
            if (eSendStatus == myStatus)
            {
                //Don't send when status of the contact is offline or appears offline or status is unknown
                var contactStatus = Messenger.MyContacts.GetContact(Email).Status;
                if (contactStatus != 1 && contactStatus != 2 && contactStatus != 0)
                {
                    //Send a message
                    var chWnd = Messenger.OpenChat(Email);
                    if (chWnd != null) chWnd.SendMessage(myMessage[2]);
                    break;
                }   
            }
        }       
    }
}

function OnEvent_ContactSignin(Email)
{
    //Get a message for signin event for this email if it exists
    var myMessage = GetMessage(Email, "SignIn");
    sendMessageWhenRequired(myMessage, Email);
}


A little explanation maybe:

code:
var myMessage = GetMessage(Email, "Signin");
GetMessage is a function in another js file wich looks in an xml file for a node with the attributes 'email' and 'signin'. If it is found an array of length 4 is returned. This array contains: the email of the contact, on which action a message is to be send, the message to send and all statusses in which a message should be automatically sent. The last value in the array is build as following: Online;Away;Busy, hence the split you see in sendMessageWhenRequired.

The function sendMessageWhenRequired is also called for all the other message that are sent and they only get delivered once.

As I also said before, the OnEvent_ContactSignin - event is executed twice ...

Try it... Make yourself a dummy account, or ask a friend to signout and in again so that you can send a message...

There just has to be a reason why that event is executed twice...

This post was edited on 08-25-2006 at 09:04 PM by DeBiese.
08-25-2006 09:02 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
OnEvent_ContactSignIn triggered twice...? - by DeBiese on 08-25-2006 at 03:41 PM
RE: OnEvent_ContactSignIn triggered twice...? - by RaceProUK on 08-25-2006 at 04:09 PM
RE: OnEvent_ContactSignIn triggered twice...? - by DeBiese on 08-25-2006 at 06:15 PM
RE: OnEvent_ContactSignIn triggered twice...? - by Deco on 08-25-2006 at 06:30 PM
RE: OnEvent_ContactSignIn triggered twice...? - by DeBiese on 08-25-2006 at 09:02 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On