Split up XMPP_handleStanza.
Non-Stanzas are now handled in separate functions
This commit is contained in:
parent
91b2a0b119
commit
683fc1e3ae
2 changed files with 106 additions and 93 deletions
|
@ -163,6 +163,9 @@
|
||||||
- (XMPPRoster*)roster;
|
- (XMPPRoster*)roster;
|
||||||
|
|
||||||
- (void)XMPP_startStream;
|
- (void)XMPP_startStream;
|
||||||
|
- (void)XMPP_handleStream: (OFXMLElement*)elem;
|
||||||
|
- (void)XMPP_handleTLS: (OFXMLElement*)elem;
|
||||||
|
- (void)XMPP_handleSASL: (OFXMLElement*)elem;
|
||||||
- (void)XMPP_handleStanza: (OFXMLElement*)elem;
|
- (void)XMPP_handleStanza: (OFXMLElement*)elem;
|
||||||
- (void)XMPP_sendAuth: (OFString*)name;
|
- (void)XMPP_sendAuth: (OFString*)name;
|
||||||
- (void)XMPP_handleIQ: (XMPPIQ*)iq;
|
- (void)XMPP_handleIQ: (XMPPIQ*)iq;
|
||||||
|
|
|
@ -297,8 +297,18 @@
|
||||||
|
|
||||||
of_log(@"In: %@", elem);
|
of_log(@"In: %@", elem);
|
||||||
|
|
||||||
|
if ([[elem namespace] isEqual: XMPP_NS_CLIENT])
|
||||||
[self XMPP_handleStanza: elem];
|
[self XMPP_handleStanza: elem];
|
||||||
|
|
||||||
|
if ([[elem namespace] isEqual: XMPP_NS_STREAM])
|
||||||
|
[self XMPP_handleStream: elem];
|
||||||
|
|
||||||
|
if ([[elem namespace] isEqual: XMPP_NS_STARTTLS])
|
||||||
|
[self XMPP_handleTLS: elem];
|
||||||
|
|
||||||
|
if ([[elem namespace] isEqual: XMPP_NS_SASL])
|
||||||
|
[self XMPP_handleSASL: elem];
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +323,6 @@
|
||||||
|
|
||||||
- (void)XMPP_handleStanza: (OFXMLElement*)elem
|
- (void)XMPP_handleStanza: (OFXMLElement*)elem
|
||||||
{
|
{
|
||||||
if ([[elem namespace] isEqual: XMPP_NS_CLIENT]) {
|
|
||||||
if ([[elem name] isEqual: @"iq"]) {
|
if ([[elem name] isEqual: @"iq"]) {
|
||||||
[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: elem]];
|
[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: elem]];
|
||||||
return;
|
return;
|
||||||
|
@ -332,18 +341,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([[elem namespace] isEqual: XMPP_NS_STREAM]) {
|
|
||||||
|
- (void)XMPP_handleStream: (OFXMLElement*)elem
|
||||||
|
{
|
||||||
if ([[elem name] isEqual: @"features"]) {
|
if ([[elem name] isEqual: @"features"]) {
|
||||||
[self XMPP_handleFeatures: elem];
|
[self XMPP_handleFeatures: elem];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([[elem namespace] isEqual: XMPP_NS_STARTTLS]) {
|
- (void)XMPP_handleTLS: (OFXMLElement*)elem
|
||||||
|
{
|
||||||
if ([[elem name] isEqual: @"proceed"]) {
|
if ([[elem name] isEqual: @"proceed"]) {
|
||||||
/* FIXME: Catch errors here */
|
/* FIXME: Catch errors here */
|
||||||
SSLSocket *newSock;
|
SSLSocket *newSock;
|
||||||
|
@ -371,9 +383,10 @@
|
||||||
@throw [OFException newWithClass: isa];
|
@throw [OFException newWithClass: isa];
|
||||||
|
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([[elem namespace] isEqual: XMPP_NS_SASL]) {
|
- (void)XMPP_handleSASL: (OFXMLElement*)elem
|
||||||
|
{
|
||||||
if ([[elem name] isEqual: @"challenge"]) {
|
if ([[elem name] isEqual: @"challenge"]) {
|
||||||
OFXMLElement *responseTag;
|
OFXMLElement *responseTag;
|
||||||
OFDataArray *challenge =
|
OFDataArray *challenge =
|
||||||
|
@ -417,9 +430,6 @@
|
||||||
reason: [elem XMLString]];
|
reason: [elem XMLString]];
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue