private void OnRegisterResult(object sender, IQ iq, object data)
{
/*
Example 6. Host Informs Entity of Failed Registration (Username Conflict)
<iq type='error' id='reg2'>
<query xmlns='jabber:iq:register'>
<username>bill</username>
<password>m1cro$oft</password>
<email>[email protected]</email>
</query>
<error code='409' type='cancel'>
<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
Example 7. Host Informs Entity of Failed Registration (Some Required Information Not Provided)
<iq type='error' id='reg2'>
<query xmlns='jabber:iq:register'>
<username>bill</username>
<password>Calliope</password>
</query>
<error code='406' type='modify'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
*/
if (iq.Type == IqType.result)
{
DoChangeXmppConnectionState(XmppConnectionState.Registered);
if (OnRegistered != null)
OnRegistered(this);
if (this.StreamVersion != null && this.StreamVersion.StartsWith("1."))
{
// init sasl login
InitSaslHandler();
m_SaslHandler.OnStreamElement(this, data as Node);
}
else
{
// old jabber style login
RequestLoginInfo();
}
}
else if (iq.Type == IqType.error)
{
if (OnRegisterError != null)
OnRegisterError(this, iq);
}
}
#endregion