powered by Jive Software

XIFF registration problems

I have no idea what the “key” String should be. The comment line

@param key (Optional) If a key was passed in the “data” field of the “registrationFields” event, that key must also be passed here.

Someone said to change the source code to this

public function sendRegistrationFields( fieldMap:Object ):void

{

var regIQ:IQ = new IQ( server, IQ.SET_TYPE, XMPPStanza.generateID(“reg_attempt_”), “sendRegistrationFields_result”, this, null );

var ext:RegisterExtension = new RegisterExtension(regIQ.getNode());

var key:Object = null;

for( var i:String in fieldMap ) {

ext.setField(i, fieldMap);

}

if (key != null) {

ext.key = key;

}

regIQ.addExtension(ext);

send( regIQ );

}

Looks be working I little bit better

import org.igniterealtime.xiff.core.XMPPConnection;

public function sendRegistrationFields( fieldMap:Object, key:String ):void

{

var regIQ:IQ = new IQ( server, IQ.SET_TYPE, XMPPStanza.generateID(“reg_attempt_”), “sendRegistrationFields_result”, this, null );

var ext:RegisterExtension = new RegisterExtension(regIQ.getNode());

for( var i:String in fieldMap ) {

ext[i] = fieldMap[i];

}

if (key != null) {

ext.key = key;

}

regIQ.addExtension(ext);

send( regIQ );

}

Any help thanks.

regInfo = ;

connection.sendRegistrationFields(regInfo);

my registrationFields:

sendRegistrationFields String name

sendRegistrationFields String password

sendRegistrationFields String username

sendRegistrationFields String x

sendRegistrationFields String email

incomingData: <iq id=“reg_attempt_4” to=“flashjabber.net/74e34768” from=“flashjabber.net” type=“error”><query xmlns=“jabber:iq:register”><name>[object Object]</name><password>[object Object]</password><username>[object Object]</username><x>[object Object]</x><email>[object Object]</email></query><error code=“500” type=“wait”><internal-server-error xmlns=“urn:ietf:params:xml:ns:xmpp-stanzas” /></error></iq>

incomingData: <iq id=“reg_attempt_6” to=“flashjabber.net/74e34768” from=“flashjabber.net” type=“error”><query xmlns=“jabber:iq:register”><name>[object Object]</name><password>[object Object]</password><username>[object Object]</username><x>[object Object]</x><email>[object Object]</email></query><error code=“500” type=“wait”><internal-server-error xmlns=“urn:ietf:params:xml:ns:xmpp-stanzas” /></error></iq>

My code is now Sean said “name is a reserved word, so you have to use something else.”

regInfo = ;

connection.sendRegistrationFields(regInfo);