Private messaging in conferencing

Description

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;

Environment

None

Activity

Mark Walters 
June 18, 2010 at 9:35 PM

This issue has been fixed in the AS3 version of XIFF.

Sean Voisen 
December 17, 2006 at 10:42 AM

AS2 ISSUE: Reinvestigate for AS3

Barry Barry 
April 21, 2005 at 10:08 AM

Original code doesn't not match current Room.as code... Sean, can you take a look at this?

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created March 15, 2005 at 11:57 PM
Updated June 18, 2010 at 9:35 PM
Resolved June 18, 2010 at 9:35 PM