This is based on a user's input from a while ago. I don't think I ever addressed the issue, but it involves a minor adjustment in the Room.as script. I haven't checked to see if his fix works or is optimal yet. Here's his e-mail:
--------------------------------------------------------------
So.. I was playing a bit with the Room.sendPrivateMessage() Method
when I realized that the privateMessageEvent was not returned correctly.
You couldnt trace it as ' type : privateMessage ' because it was
returned as ' type : incomingData '.
So I dig a little in the Room.as and correct it:
------------------------
Original:
case "message":
var msg:Message = eventObj.data;
// Check to see that the message is from this room
if( isFromThisRoom( msg.from ) && msg.type ==
Message.GROUPCHAT_TYPE ) {
// Check for a subject change
if( msg.subject != null ) {
var eventObj:Object = {target:this,
type:"subjectChange", subject:msg.subject};
dispatchEvent( eventObj );
}
else {
var eventObj:Object = {target:this,
type:"groupMessage", data:msg};
dispatchEvent( eventObj );
}
}
// It could be a private message via the conference
else if( msg.to == getFullRoomName() + "/" + nickname
&& msg.type == Message.CHAT_TYPE ) {
var eventObj:Object = {target:this,
type:"privateMessage", data:msg};
dispatchEvent( eventObj );
}
break;
----------------------------------------
Corrected: (line 376) // Check to see that the PRIVATE message is from this room
case "message":
var msg:Message = eventObj.data;
// Check to see that the message is from this room
if( isFromThisRoom( msg.from ) && msg.type ==
Message.GROUPCHAT_TYPE ) {
// Check for a subject change
if( msg.subject != null ) {
var eventObj:Object = {target:this,
type:"subjectChange", subject:msg.subject};
dispatchEvent( eventObj );
}
else {
var eventObj:Object = {target:this,
type:"groupMessage", data:msg};
dispatchEvent( eventObj );
}
}
// Check to see that the PRIVATE message is from this room
else if( isFromThisRoom( msg.from ) && msg.type ==
Message.CHAT_TYPE ) {
// Check for a subject change
if( msg.subject != null ) {
var eventObj:Object = {target:this,
type:"subjectChange", subject:msg.subject};
dispatchEvent( eventObj );
}
else {
var eventObj:Object = {target:this,
type:"privateMessage", data:msg};
dispatchEvent( eventObj );
}
}
// It could be a private message via the conference
else if( msg.to == getFullRoomName() + "/" + nickname
&& msg.type == Message.CHAT_TYPE ) {
var eventObj:Object = {target:this,
type:"privateMessage", data:msg};
dispatchEvent( eventObj );
}
break;
Original code doesn't not match current Room.as code... Sean, can you take a look at this?
AS2 ISSUE: Reinvestigate for AS3
This issue has been fixed in the AS3 version of XIFF.