powered by Jive Software

Moderator, Visitor, Participant and kick a user : Room.as - bugfix?

I wrote things about this problem in November 2004 and saw it isn’‘t fixed yet… so I’'m going for a second try…

It is impossible in 200B3 to kick an user, or change its Role (if you are owner or mod. of course!)…

in Room.as[/u] at line 410 change

ext.addItem(null, MUC.NO_ROLE, null, null, null, reason);[/i]

into

ext.addItem(null, MUC.NO_ROLE, occupantNick[/b], null, null, reason);[/i]

And you could do the same for setOccupantVoice function at line 428.

As I wanted to grant ppl to moderator, I tried more modifications, which are working well:

public function setOccupantVoice( occupantNick:String, newRole:String /b):Void

{

if( isActive() ) {

var tempIQ:IQ = new IQ( getRoomJID(), IQ.SET_TYPE, XMPPStanza.generateID(“voice_”) );

var ext:MUCAdminExtension = new MUCAdminExtension(tempIQ.getNode());

ext.addItem(null, newRole[/b],occupantNick);

tempIQ.addExtension(ext);

myConnection.send( tempIQ );

}

}

/i

I can change a nickname Role by using one of these examples:[i]

chatRoom.setOccupantVoice(selectedNickname,MUC.MODERATOR_ROLE);

chatRoom.setOccupantVoice(selectedNickname,MUC.VISITOR_ROLE);

chatRoom.setOccupantVoice(selectedNickname,MUC.PARTICIPANT_ROLE);[/i]

This has been filed as XIFF-11 pending review and fix

Yet another bugs…

The nickConflict event is returned to all rooms… which could be improved by adding the bold lines to the Room.as[/u] into line 665 and 670 (approx.)

if (presence.type == Presence.ERROR_TYPE) {

if(isThisRoom( presence.from )){ //Don’'t dispatch to any opened room! just the good one![/b]

switch (presence.errorCode) {

case 409:

dispatchEvent({type:“nickConflict”, target:this, nickname:nickname});

break;

}

}[/b]

}

/i

And for privateMessage event, I updated the sean voisen #XIFF-3 and it seem to work well

Remove this part (lines 644 to 648 approx.)

// It could be a private message via the conference

else if( isThisUser(msg.to) && msg.type == Message.CHAT_TYPE ) {

trace(“private”);

}

Add the bold lines into lines 629 (approx.)

else if ( msg.type == Message.NORMAL_TYPE ) {

}

else if (msg.type == Message.CHAT_TYPE) { // It’'s a private chat message

dispatchEvent( {target:this, type:“privateMessage”, data:msg} );

}[/b]