Overview
Comment: | Make use of -[elementsForName:]. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
fbe5acc6216d9c5efdf9154674c769d9 |
User & Date: | js on 2011-02-19 16:23:36 |
Other Links: | manifest | tags |
Context
2011-02-19
| ||
16:38 | Make XMPPJID conform to OFCopying. check-in: 58db21b120 user: js tags: trunk | |
16:23 | Make use of -[elementsForName:]. check-in: fbe5acc621 user: js tags: trunk | |
15:08 | Remove old attributes before adding new ones. check-in: 51f917ae30 user: js tags: trunk | |
Changes
Modified src/XMPPConnection.m from [162b90dd45] to [c09c538201].
︙ | ︙ | |||
219 220 221 222 223 224 225 | assert(0); } } parser.delegate = elementBuilder; } | < < < < < < < | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | assert(0); } } parser.delegate = elementBuilder; } - (void)_sendPLAINAuth { OFXMLElement *authTag; OFDataArray *message; message = [OFDataArray dataArrayWithItemSize: 1]; /* XXX: authzid would go here */ |
︙ | ︙ | |||
257 258 259 260 261 262 263 | [message stringByBase64Encoding]]]; [self sendStanza: authTag]; } - (void)_sendResourceBind { | | > | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | [message stringByBase64Encoding]]]; [self sendStanza: authTag]; } - (void)_sendResourceBind { XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"bind0"]; OFXMLElement *bind = [OFXMLElement elementWithName: @"bind" namespace: NS_BIND]; if (resource) [bind addChild: [OFXMLElement elementWithName: @"resource" stringValue: resource]]; [iq addChild: bind]; |
︙ | ︙ | |||
283 284 285 286 287 288 289 | [jidElem.children.firstObject stringValue]]; of_log(@"Bound to JID: %@", [JID fullJID]); } } - (void)_handleFeatures: (OFXMLElement*)elem { | < | | < | | < | > > > > > | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | [jidElem.children.firstObject stringValue]]; of_log(@"Bound to JID: %@", [JID fullJID]); } } - (void)_handleFeatures: (OFXMLElement*)elem { OFArray *mechs = [elem elementsForName: @"mechanisms" namespace: NS_SASL]; OFXMLElement *bind = [elem elementsForName: @"bind" namespace: NS_BIND].firstObject; for (OFXMLElement *mech in mechs) [mechanisms addObject: mech.name]; if ([mechanisms containsObject: @"PLAIN"]) [self _sendPLAINAuth]; if (bind != nil) [self _sendResourceBind]; } - (void)elementBuilder: (OFXMLElementBuilder*)b didBuildElement: (OFXMLElement*)elem { elem.defaultNamespace = NS_CLIENT; [elem setPrefix: @"stream" |
︙ | ︙ |