Xiff messaging help

Hi Guys,

I have been following Veloffs example of his xiff chat application http://velloff.com/XIFF_AS3/XIFF_AS3_GUI.html but i have changed the library to the new xiff 3 beta. And im having difficulty with the personal Popup messages. Can someone have a look at this modified code and see where im going wrong thanks. Basically though in the log output the recipient is receiving the message, the fault lies somewhere in the message handler with the RosterItemVO that im using as this is not getting the ri.show or ri.status values. In veloff message handler he uses the old Roster.as which has a function called getContactInformation which is not in the new Roster lib. So not sure on how to do this.

– code –

/* Message Handler */

internal function messageHandler(e:MessageEvent):Boolean
{
var m:Message = e.data as Message;
talog.text += '\n\n>>MESSAGE HANDLER: '+ e.data + ‘\n’;
talog.text += '\nTYPE: '+ m.type + ‘\n’;
switch (m.type){
case Message.CHAT_TYPE :
if (_messageDict[m.from.toBareJID()])
{
talog.text += "MESSAGE FROM " + m.from.toBareJID();
var p:MessagePopup = _messageDict[m.from.toBareJID()] as MessagePopup;
p.messageReceived(m.body);
return true;
}
try
{
//Something wrong here
var ri:RosterItemVO = _messageDict[m.from.toBareJID()] as RosterItemVO;
addPersonalPopupWindow( m.from, ri.show, ri.status, m);
}

                    catch (e:Error)
                    {
                        talog.text += e.errorID;
                    }
                   
                    break;
                   
                case Message.ERROR_TYPE :
                    var error:XIFFErrorEvent = new XIFFErrorEvent();
                    error.errorCode = m.errorCode;
                    error.errorCondition = m.errorCondition;
                    error.errorMessage = m.errorMessage;
                    error.errorType = m.errorType;
                    onError(error);
                    break;
                default :
            }
            return true;
        }

/* addPersonalPopupWindow */

internal function addPersonalPopupWindow (userJID:JID, userPresence:String, userStatus:String, msg:Message=null, userPic:String=null) : void
{
var p:MessagePopup = new MessagePopup();
p.addEventListener(MessageEvent.MESSAGE, sendMessage);
p.addEventListener(MessagePopup.CLOSE, distroyPersonalPopupWindow);
p.uPresence = userPresence;
p.uStatus = userStatus;
p.fromJID = _currUserJID;
p.toJID = userJID;
if (msg != null)
{
p.messageReceived(msg.body);
}
PopUpManager.addPopUp(p,this,false);
PopUpManager.centerPopUp§;
_messageDict[userJID.toBareJID()] = p;
}