ObjXMPP  Diff

Differences From Artifact [edc286114d]:

To Artifact [b0f0c109e0]:


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
65
66
67
68
69
70
71

72
73
74
75
76
77
78







-







}

- init
{
	self = [super init];

	@try {
		sock = [[OFTCPSocket alloc] init];
		port = 5222;
		encrypted = NO;
		streamOpen = NO;
		delegates = [[XMPPMulticastDelegate alloc] init];
		callbacks = [[OFMutableDictionary alloc] init];
	} @catch (id e) {
		[self release];
253
254
255
256
257
258
259






260
261
262
263
264
265
266
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271







+
+
+
+
+
+







- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	XMPPSRVEntry *candidate = nil;
	XMPPSRVLookup *SRVLookup = nil;
	OFEnumerator *enumerator;

	if (sock != nil)
		@throw [OFAlreadyConnectedException
		    exceptionWithClass: [self class]];

	sock = [[OFTCPSocket alloc] init];

	if (server)
		[sock connectToHost: [self XMPP_IDNAToASCII: server]
			       port: port];
	else {
		@try {
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: domainToASCII];
631
632
633
634
635
636
637
638

639
640
641















642
643
644
645
646
647
648
636
637
638
639
640
641
642

643
644


645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666







-
+

-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







			   @"version='1.0'>", domain, langString];

	streamOpen = YES;
}

- (void)close
{
	if (streamOpen) {
	if (streamOpen)
		[sock writeString: @"</stream:stream>"];
		streamOpen = NO;
	}


	[oldParser release];
	oldParser = nil;
	[oldElementBuilder release];
	oldElementBuilder = nil;
	[authModule release];
	authModule = nil;
	[sock release];
	sock = nil;
	[JID release];
	JID = nil;
	streamOpen = needsSession = encrypted = NO;
	supportsRosterVersioning = supportsStreamManagement = NO;
	lastID = 0;
}

- (void)XMPP_handleStanza: (OFXMLElement*)element
{
	if ([[element name] isEqual: @"iq"]) {
		[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: element]];
		return;