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;
|
||||
|
||||
- (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_sendAuth: (OFString*)name;
|
||||
- (void)XMPP_handleIQ: (XMPPIQ*)iq;
|
||||
|
|
|
@ -297,8 +297,18 @@
|
|||
|
||||
of_log(@"In: %@", elem);
|
||||
|
||||
if ([[elem namespace] isEqual: XMPP_NS_CLIENT])
|
||||
[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];
|
||||
}
|
||||
|
||||
|
@ -313,7 +323,6 @@
|
|||
|
||||
- (void)XMPP_handleStanza: (OFXMLElement*)elem
|
||||
{
|
||||
if ([[elem namespace] isEqual: XMPP_NS_CLIENT]) {
|
||||
if ([[elem name] isEqual: @"iq"]) {
|
||||
[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: elem]];
|
||||
return;
|
||||
|
@ -334,7 +343,9 @@
|
|||
assert(0);
|
||||
}
|
||||
|
||||
if ([[elem namespace] isEqual: XMPP_NS_STREAM]) {
|
||||
|
||||
- (void)XMPP_handleStream: (OFXMLElement*)elem
|
||||
{
|
||||
if ([[elem name] isEqual: @"features"]) {
|
||||
[self XMPP_handleFeatures: elem];
|
||||
return;
|
||||
|
@ -343,7 +354,8 @@
|
|||
assert(0);
|
||||
}
|
||||
|
||||
if ([[elem namespace] isEqual: XMPP_NS_STARTTLS]) {
|
||||
- (void)XMPP_handleTLS: (OFXMLElement*)elem
|
||||
{
|
||||
if ([[elem name] isEqual: @"proceed"]) {
|
||||
/* FIXME: Catch errors here */
|
||||
SSLSocket *newSock;
|
||||
|
@ -373,7 +385,8 @@
|
|||
assert(0);
|
||||
}
|
||||
|
||||
if ([[elem namespace] isEqual: XMPP_NS_SASL]) {
|
||||
- (void)XMPP_handleSASL: (OFXMLElement*)elem
|
||||
{
|
||||
if ([[elem name] isEqual: @"challenge"]) {
|
||||
OFXMLElement *responseTag;
|
||||
OFDataArray *challenge =
|
||||
|
@ -420,9 +433,6 @@
|
|||
assert(0);
|
||||
}
|
||||
|
||||
assert(0);
|
||||
}
|
||||
|
||||
- (void)XMPP_handleIQ: (XMPPIQ*)iq
|
||||
{
|
||||
BOOL handled = NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue