Handle message event ???

Last post 08-26-2009, 4:03 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  08-26-2009, 2:32 AM 55054

    Handle message event ???

    How can i handle the event when a message come?
    i want notify to user when they have messages that they haven't active the browser window.
  •  08-26-2009, 4:03 AM 55056 in reply to 55054

    Re: Handle message event ???

    Hi,
     
    Use this Java Script:
     
    AttachChatEvent("MESSAGE",handleMessage);
     
    function handleMessage(name,type,info1,info2)
    {
        //name should be "MESSAGE"
        //type should be "NEW"
        var msg=info1;
        if(msg.Type=="USER")
        {
            //use :
            //msg.Sender.UserId,msg.Sender.DisplayName
            //msg.Target.UserId,msg.Target.DisplayName
            //msg.Html,msg.Text..
        }
    }
     
    Regards,
    Terry
     
View as RSS news feed in XML