ObjXMPP  Check-in [6f83a74d30]

Overview
Comment:Add sendStanza to XMPPConnection
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6f83a74d30a2ea84a80219c683403fb3dbc451236fd76ac2e8d5f51fa2a63725
User & Date: florob@babelmonkeys.de on 2011-02-10 22:46:47
Other Links: manifest | tags
Context
2011-02-10
23:59
Do Nodeprep on username and add Makefile check-in: d745afc94c user: florob@babelmonkeys.de tags: trunk
22:46
Add sendStanza to XMPPConnection check-in: 6f83a74d30 user: florob@babelmonkeys.de tags: trunk
22:30
Add/use init functions in the XMPPStanza classes check-in: 56c7baa520 user: florob@babelmonkeys.de tags: trunk
Changes

Modified XMPPConnection.h from [c80e848a7e] to [7ed5d921f4].

36
37
38
39
40
41
42

43
36
37
38
39
40
41
42
43
44







+

@property (copy) OFString *resource;
@property (assign) short port;
@property (assign) BOOL useTLS;
@property (retain) id <XMPPConnectionDelegate> delegate;

- (void)connect;
- (void)handleConnection;
- (void)sendStanza: (OFXMLElement*)elem;
@end

Modified XMPPConnection.m from [e6924adf47] to [9b0fcf1270].

74
75
76
77
78
79
80





81
82
83
84
85
86
87
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92







+
+
+
+
+








		[of_stdout writeNBytes: len
			    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
       attributes: (OFArray*)attrs
{
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
154







-
+








-
+







	authTag = [OFXMLElement elementWithName: @"auth"
				      namespace: NS_SASL];
	[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) {
		if ([[child name] isEqual: @"mechanisms"] &&
		    [[child namespace] isEqual: NS_SASL])