@@ -76,10 +76,15 @@ fromBuffer: buf]; [parser parseBuffer: buf withSize: len]; } } + +- (void)sendStanza: (OFXMLElement*)elem +{ + [sock writeString: [elem stringValue]]; +} - (void)parser: (OFXMLParser*)p didStartElement: (OFString*)name withPrefix: (OFString*)prefix namespace: (OFString*)ns @@ -128,20 +133,20 @@ [authTag addAttributeWithName: @"mechanism" stringValue: @"PLAIN"]; [authTag addChild: [OFXMLElement elementWithCharacters: [message stringByBase64Encoding]]]; - [sock writeString: [authTag stringValue]]; + [self sendStanza: authTag]; } - (void)_sendResourceBind { XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"bind0"]; [iq addChild: [OFXMLElement elementWithName: @"bind" namespace: NS_BIND]]; - [sock writeString: [iq stringValue]]; + [self sendStanza: iq]; } - (void)_handleFeatures: (OFXMLElement*)elem { for (OFXMLElement *child in elem.children) {