diff --git a/XMPPConnection.h b/XMPPConnection.h index 5083b1e..8305896 100644 --- a/XMPPConnection.h +++ b/XMPPConnection.h @@ -40,4 +40,5 @@ - (void)connect; - (void)handleConnection; +- (void)sendStanza: (OFXMLElement*)elem; @end diff --git a/XMPPConnection.m b/XMPPConnection.m index 4bd6642..ea8c1de 100644 --- a/XMPPConnection.m +++ b/XMPPConnection.m @@ -79,6 +79,11 @@ } } +- (void)sendStanza: (OFXMLElement*)elem +{ + [sock writeString: [elem stringValue]]; +} + - (void)parser: (OFXMLParser*)p didStartElement: (OFString*)name withPrefix: (OFString*)prefix @@ -130,7 +135,7 @@ [authTag addChild: [OFXMLElement elementWithCharacters: [message stringByBase64Encoding]]]; - [sock writeString: [authTag stringValue]]; + [self sendStanza: authTag]; } - (void)_sendResourceBind @@ -139,7 +144,7 @@ [iq addChild: [OFXMLElement elementWithName: @"bind" namespace: NS_BIND]]; - [sock writeString: [iq stringValue]]; + [self sendStanza: iq]; } - (void)_handleFeatures: (OFXMLElement*)elem