Comment: | Port to ObjC 1. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2f8a95152e6d5ad68007c1cc4d23c61d |
User & Date: | js on 2011-03-29 01:46:20 |
Other Links: | manifest | tags |
2011-03-29
| ||
01:51 | Import <bsd/stdlib.h> if not on a BSD system. Still needs LIBS=-lbsd. check-in: 168813e54d user: js tags: trunk | |
01:46 | Port to ObjC 1. check-in: 2f8a95152e user: js tags: trunk | |
00:04 | Get rid of unused variable useTLS. check-in: c6162edb52 user: js tags: trunk | |
Modified ObjXMPP.xcodeproj/project.pbxproj from [b60ab9486b] to [4b39058b85].
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - | 4BC55A011337AC1800E345C7 /* XMPPStanza.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC559FE1337AC1800E345C7 /* XMPPStanza.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BC55A021337AC1800E345C7 /* XMPPStanza.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC559FF1337AC1800E345C7 /* XMPPStanza.m */; }; 4BD0AB16134129B900445289 /* ObjOpenSSL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD0AB15134129B900445289 /* ObjOpenSSL.framework */; }; 4BD9BF59134003F700DAB43A /* XMPPRosterItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD9BF57134003F700DAB43A /* XMPPRosterItem.h */; }; 4BD9BF5A134003F700DAB43A /* XMPPRosterItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD9BF58134003F700DAB43A /* XMPPRosterItem.m */; }; 4BDEF8071340B240000156D1 /* XMPPRoster.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDEF8051340B240000156D1 /* XMPPRoster.h */; }; 4BDEF8081340B240000156D1 /* XMPPRoster.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BDEF8061340B240000156D1 /* XMPPRoster.m */; }; |
︙ | |||
80 81 82 83 84 85 86 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | - | 4BC559FF1337AC1800E345C7 /* XMPPStanza.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPStanza.m; path = src/XMPPStanza.m; sourceTree = SOURCE_ROOT; }; 4BC55A051337ADA800E345C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; 4BD0AB15134129B900445289 /* ObjOpenSSL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjOpenSSL.framework; path = ../ObjOpenSSL/build/Debug/ObjOpenSSL.framework; sourceTree = "<group>"; }; 4BD9BF57134003F700DAB43A /* XMPPRosterItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPRosterItem.h; path = src/XMPPRosterItem.h; sourceTree = SOURCE_ROOT; }; 4BD9BF58134003F700DAB43A /* XMPPRosterItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPRosterItem.m; path = src/XMPPRosterItem.m; sourceTree = SOURCE_ROOT; }; 4BDEF8051340B240000156D1 /* XMPPRoster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPRoster.h; path = src/XMPPRoster.h; sourceTree = SOURCE_ROOT; }; 4BDEF8061340B240000156D1 /* XMPPRoster.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPRoster.m; path = src/XMPPRoster.m; sourceTree = SOURCE_ROOT; }; |
︙ | |||
162 163 164 165 166 167 168 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - | 4BC559E41337AC0900E345C7 /* XMPPMessage.h */, 4BC559E51337AC0900E345C7 /* XMPPMessage.m */, 4BC559E61337AC0900E345C7 /* XMPPPLAINAuth.h */, 4BC559E71337AC0900E345C7 /* XMPPPLAINAuth.m */, 4BC559E81337AC0900E345C7 /* XMPPPresence.h */, 4BC559E91337AC0900E345C7 /* XMPPPresence.m */, 4BDEF8051340B240000156D1 /* XMPPRoster.h */, |
︙ | |||
202 203 204 205 206 207 208 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - | 4BC559F61337AC0900E345C7 /* XMPPMessage.h in Headers */, 4BC559F81337AC0900E345C7 /* XMPPPLAINAuth.h in Headers */, 4BC559FA1337AC0900E345C7 /* XMPPPresence.h in Headers */, 4BC559FC1337AC0900E345C7 /* XMPPSCRAMAuth.h in Headers */, 4BC55A011337AC1800E345C7 /* XMPPStanza.h in Headers */, 4BD9BF59134003F700DAB43A /* XMPPRosterItem.h in Headers */, 4BDEF8071340B240000156D1 /* XMPPRoster.h in Headers */, |
︙ |
Modified src/Makefile from [942a976e26] to [57b35db95f].
1 | 1 2 3 4 5 6 | - + | all: |
Modified src/XMPPAuthenticator.h from [d4a2643832] to [cf4b0ef3fa].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - - - + + + + + + | #import <ObjFW/ObjFW.h> /** * \brief A base class for classes implementing authentication mechanisms */ @interface XMPPAuthenticator: OFObject { |
︙ | |||
75 76 77 78 79 80 81 82 | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + + + + + + + | /** * Checks whether the servers final message was valid * * \param message The servers final message */ - (void)parseServerFinalMessage: (OFDataArray*)message; - (void)setAuthzid: (OFString*)authzid; - (OFString*)authzid; - (void)setAuthcid: (OFString*)authcid; - (OFString*)authcid; - (void)setPassword: (OFString*)password; - (OFString*)password; @end |
Modified src/XMPPAuthenticator.m from [6b8d4dd60e] to [9855270d5d].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - - - | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "XMPPAuthenticator.h" @implementation XMPPAuthenticator |
︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | { [authzid release]; [authcid release]; [password release]; [super dealloc]; } - (void)setAuthzid: (OFString*)authzid_ { OFString *old = authzid; authzid = [authzid_ copy]; [old release]; } - (OFString*)authzid { return [[authzid copy] autorelease]; } - (void)setAuthcid: (OFString*)authcid_ { OFString *old = authcid; authcid = [authcid_ copy]; [old release]; } - (OFString*)authcid { return [[authcid copy] autorelease]; } - (void)setPassword: (OFString*)password_ { OFString *old = password; password = [password_ copy]; [old release]; } - (OFString*)password { return [[password copy] autorelease]; } - (OFDataArray*)clientFirstMessage { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } |
︙ |
Modified src/XMPPConnection.h from [d775d14285] to [0ccafcf867].
︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + + + + - - + + + + + + | #define XMPP_NS_SASL @"urn:ietf:params:xml:ns:xmpp-sasl" #define XMPP_NS_STARTTLS @"urn:ietf:params:xml:ns:xmpp-tls" #define XMPP_NS_STANZAS @"urn:ietf:params:xml:ns:xmpp-stanzas" #define XMPP_NS_SESSION @"urn:ietf:params:xml:ns:xmpp-session" #define XMPP_NS_STREAM @"http://etherx.jabber.org/streams" @protocol XMPPConnectionDelegate #ifndef XMPP_CONNECTION_M <OFObject> #endif #ifdef OF_HAVE_OPTIONAL_PROTOCOLS @optional #endif - (void)connectionWasAuthenticated: (XMPPConnection*)conn; - (void)connection: (XMPPConnection*)conn wasBoundToJID: (XMPPJID*)jid; - (void)connectionDidReceiveRoster: (XMPPConnection*)conn; - (BOOL)connection: (XMPPConnection*)conn didReceiveIQ: (XMPPIQ*)iq; - (void)connection: (XMPPConnection*)conn didReceivePresence: (XMPPPresence*)pres; - (void)connection: (XMPPConnection*)conn didReceiveMessage: (XMPPMessage*)msg; - (void)connectionWasClosed: (XMPPConnection*)conn; @end /** * \brief A class which abstracts a connection to an XMPP service. */ |
︙ | |||
105 106 107 108 109 110 111 112 | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | */ - (OFString*)generateStanzaID; /** * Requests the roster. */ - (void)requestRoster; - (void)setUsername: (OFString*)username; - (OFString*)username; - (void)setPassword: (OFString*)password; - (OFString*)password; - (void)setServer: (OFString*)server; - (OFString*)server; - (void)setResource: (OFString*)resource; - (OFString*)resource; - (XMPPJID*)JID; - (void)setPort: (uint16_t)port; - (uint16_t)port; - (void)setDelegate: (id <XMPPConnectionDelegate>)delegate; - (id <XMPPConnectionDelegate>)delegate; - (XMPPRoster*)roster; - (void)XMPP_startStream; - (void)XMPP_handleStanza: (OFXMLElement*)elem; - (void)XMPP_sendAuth: (OFString*)name; - (void)XMPP_handleIQ: (XMPPIQ*)iq; - (void)XMPP_handleMessage: (XMPPMessage*)msg; - (void)XMPP_handlePresence: (XMPPPresence*)pres; - (void)XMPP_handleFeatures: (OFXMLElement*)elem; - (void)XMPP_sendResourceBind; - (void)XMPP_handleResourceBind: (XMPPIQ*)iq; - (void)XMPP_sendSession; - (void)XMPP_handleSession: (XMPPIQ*)iq; - (void)XMPP_handleRoster: (XMPPIQ*)iq; @end @interface OFObject (XMPPConnectionDelegate) <XMPPConnectionDelegate> @end |
Modified src/XMPPConnection.m from [8c7125d78b] to [a4f8793bd7].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + - - - - - - - - - - - - - - - - - - - - + + | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #define XMPP_CONNECTION_M #include <assert.h> #include <stringprep.h> #include <idna.h> #import <ObjOpenSSL/SSLSocket.h> #import "XMPPConnection.h" #import "XMPPSCRAMAuth.h" #import "XMPPPLAINAuth.h" #import "XMPPStanza.h" #import "XMPPJID.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" #import "XMPPRoster.h" |
︙ | |||
162 163 164 165 166 167 168 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - - - - + + + + | OFString *old = server; char *srv; Idna_rc rc; if ((rc = idna_to_ascii_8z([server_ cString], &srv, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) @throw [XMPPIDNATranslationFailedException |
︙ | |||
254 255 256 257 258 259 260 261 262 263 264 265 266 267 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | + + + - - - + + + - + - + | - (void)parser: (OFXMLParser*)p didStartElement: (OFString*)name withPrefix: (OFString*)prefix namespace: (OFString*)ns attributes: (OFArray*)attrs { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFEnumerator *enumerator; OFXMLAttribute *attr; if (![name isEqual: @"stream"] || ![prefix isEqual: @"stream"] || ![ns isEqual: XMPP_NS_STREAM]) { of_log(@"Did not get expected stream start!"); assert(0); } enumerator = [attrs objectEnumerator]; |
︙ | |||
301 302 303 304 305 306 307 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | - - + + - + - + - - + + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - - + + - | @"xmlns='" XMPP_NS_CLIENT @"' " @"xmlns:stream='" XMPP_NS_STREAM @"' " @"version='1.0'>", server]; } - (void)XMPP_handleStanza: (OFXMLElement*)elem { |
︙ | |||
463 464 465 466 467 468 469 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | - - - - + + + + - - + + - - + + + + + + - + | [delegate connection: self didReceivePresence: pres]; } - (void)XMPP_handleFeatures: (OFXMLElement*)elem { OFXMLElement *starttls = |
︙ | |||
557 558 559 560 561 562 563 | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - + - + - - + + - + - + | } - (void)XMPP_handleResourceBind: (XMPPIQ*)iq { OFXMLElement *bindElem; OFXMLElement *jidElem; |
︙ | |||
597 598 599 600 601 602 603 | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 | - + | [iq addChild: [OFXMLElement elementWithName: @"session" namespace: XMPP_NS_SESSION]]; [self sendStanza: iq]; } - (void)XMPP_handleSession: (XMPPIQ*)iq { |
︙ | |||
626 627 628 629 630 631 632 633 | 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 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 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 | + + - + - + - - + + - + + + + - - + + - - - - - + + + + + + - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | namespace: XMPP_NS_ROSTER]]; [self sendStanza: iq]; } - (void)XMPP_handleRoster: (XMPPIQ*)iq { OFXMLElement *rosterElem; OFEnumerator *enumerator; OFXMLElement *elem; |
Modified src/XMPPExceptions.h from [e4ea710d7a] to [2a495c565d].
︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + + + + + + + + + | @class XMPPAuthenticator; @interface XMPPException: OFException { XMPPConnection *connection; } #ifdef OF_HAVE_PROPERTIES @property (readonly, nonatomic) XMPPConnection *connection; #endif + newWithClass: (Class)class_ connection: (XMPPConnection*)conn; - initWithClass: (Class)class_ connection: (XMPPConnection*)conn; - (XMPPConnection*)connection; @end @interface XMPPStringPrepFailedException: XMPPException { OFString *profile; OFString *string; } #ifdef OF_HAVE_PROPERTIES @property (readonly, nonatomic) OFString *profile, *string; #endif + newWithClass: (Class)class_ connection: (XMPPConnection*)conn profile: (OFString*)profile string: (OFString*)string; - initWithClass: (Class)class_ connection: (XMPPConnection*)conn profile: (OFString*)profile string: (OFString*)string; - (OFString*)profile; - (OFString*)string; @end @interface XMPPIDNATranslationFailedException: XMPPException { OFString *operation; OFString *string; } #ifdef OF_HAVE_PROPERTIES @property (readonly, nonatomic) OFString *operation, *string; #endif + newWithClass: (Class)class_ connection: (XMPPConnection*)conn operation: (OFString*)operation string: (OFString*)string; - initWithClass: (Class)class_ connection: (XMPPConnection*)conn operation: (OFString*)operation string: (OFString*)string; - (OFString*)operation; - (OFString*)string; @end @interface XMPPAuthFailedException: XMPPException { OFString *reason; } #ifdef OF_HAVE_PROPERTIES @property (readonly, nonatomic) OFString *reason; #endif + newWithClass: (Class)class_ connection: (XMPPConnection*)conn reason: (OFString*)reason_; - initWithClass: (Class)class_ connection: (XMPPConnection*)conn reason: (OFString*)reason_; - (OFString*)reason; @end |
Modified src/XMPPExceptions.m from [e5e54a18a7] to [95ac10b065].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "XMPPExceptions.h" @implementation XMPPException |
︙ | |||
68 69 70 71 72 73 74 75 76 77 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + + - - | return description; description = [[OFString alloc] initWithFormat: @"An exception occurred in class %@!", inClass]; return description; } - (XMPPConnection*)connection { return connection; } @end @implementation XMPPStringPrepFailedException |
︙ | |||
131 132 133 134 135 136 137 138 139 140 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + + + + + + + + + - - | description = [[OFString alloc] initWithFormat: @"Stringprep with profile %@ failed on string '%@'!", profile, string]; return description; } - (OFString*)profile { return profile; } - (OFString*)string { return string; } @end @implementation XMPPIDNATranslationFailedException |
︙ | |||
193 194 195 196 197 198 199 200 201 202 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | + + + + + + + + + + - - | return description; description = [[OFString alloc] initWithFormat: @"IDNA operation %@ failed on string '%@'!", operation, string]; return description; } - (OFString*)operation { return operation; } - (OFString*)string { return string; } @end @implementation XMPPAuthFailedException |
︙ | |||
250 251 252 253 254 255 256 257 | 267 268 269 270 271 272 273 274 275 276 277 278 279 | + + + + + | return description; description = [[OFString alloc] initWithFormat: @"Authentication failed. Reason: %@!", reason]; return description; } - (OFString*)reason { return reason; } @end |
Modified src/XMPPJID.h from [77ccbb27f8] to [0a05a907db].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - - - + + + + + | #import <ObjFW/ObjFW.h> /** * \brief A class for easy handling of JIDs. */ @interface XMPPJID: OFObject <OFCopying> { |
︙ | |||
68 69 70 71 72 73 74 75 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + + + + + + + | */ - (OFString*)bareJID; /** * \return An OFString containing the full JID */ - (OFString*)fullJID; - (void)setNode: (OFString*)node; - (OFString*)node; - (void)setDomain: (OFString*)domain; - (OFString*)domain; - (void)setResource: (OFString*)resource; - (OFString*)resource; @end |
Modified src/XMPPRoster.h from [00bb9602be] to [6e37e7971b].
︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + | @interface XMPPRoster: OFObject { XMPPConnection *connection; OFMutableDictionary *groups; } - initWithConnection: (XMPPConnection*)conn; - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem; - (OFArray*)groups; - (OFArray*)rosterItemsInGroup: (OFString*)group; - (void)addRosterItem: (XMPPRosterItem*)rosterItem; - (void)updateRosterItem: (XMPPRosterItem*)rosterItem; - (void)deleteRosterItem: (XMPPRosterItem*)rosterItem; @end |
Modified src/XMPPRoster.m from [cafcc94476] to [401105b7c9].
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "XMPPRoster.h" |
︙ | |||
48 49 50 51 52 53 54 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - - + + + + + + | [connection release]; [super dealloc]; } - (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem { |
︙ | |||
77 78 79 80 81 82 83 84 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + - + + | [rosterGroup addObject: rosterItem]; } } - (OFArray*)groups { OFMutableArray *ret = [OFMutableArray array]; OFEnumerator *enumerator; OFString *group; |
︙ | |||
106 107 108 109 110 111 112 113 114 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | + + - - + + - + - + + - + | { XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: [connection generateStanzaID]]; OFXMLElement *query = [OFXMLElement elementWithName: @"query" namespace: XMPP_NS_ROSTER]; OFXMLElement *item = [OFXMLElement elementWithName: @"item" namespace: XMPP_NS_ROSTER]; OFEnumerator *enumerator; OFString *group; [item addAttributeWithName: @"jid" |
Modified src/XMPPRosterItem.h from [710a1a3d37] to [3813168f1c].
︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + + + + + + + + + + | { XMPPJID *JID; OFString *name; OFString *subscription; OFArray *groups; } #ifdef OF_HAVE_PROPERTIES @property (copy) XMPPJID *JID; @property (copy) OFString *name; @property (copy) OFString *subscription; @property (copy) OFArray *groups; #endif + rosterItem; - (void)setJID: (XMPPJID*)JID; - (XMPPJID*)JID; - (void)setName: (OFString*)name; - (OFString*)name; - (void)setSubscription: (OFString*)subscription; - (OFString*)subscription; - (void)setGroups: (OFArray*)groups; - (OFArray*)groups; @end |
Modified src/XMPPRosterItem.m from [f9f8c64e09] to [55445a1531].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - - + + + + + + + + + + | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "XMPPRosterItem.h" @implementation XMPPRosterItem |
︙ | |||
49 50 51 52 53 54 55 56 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | - (OFString*)description { return [OFString stringWithFormat: @"<XMPPRosterItem, JID=%@, name=%@, " @"subscription=%@, groups=%@>", JID, name, subscription, groups]; } - (void)setJID: (XMPPJID*)JID_ { XMPPJID *old = JID; JID = [JID_ copy]; [old release]; } - (XMPPJID*)JID { return [[JID copy] autorelease]; } - (void)setName: (OFString*)name_ { OFString *old = name; name = [name_ copy]; [old release]; } - (OFString*)name { return [[name copy] autorelease]; } - (void)setSubscription: (OFString*)subscription_ { OFString *old = subscription; subscription = [subscription_ copy]; [old release]; } - (OFString*)subscription { return [[subscription copy] autorelease]; } - (void)setGroups: (OFArray*)groups_ { OFArray *old = groups; groups = [groups_ copy]; [old release]; } - (OFArray*)groups { return [[groups copy] autorelease]; } @end |
Deleted src/XMPPRoster_private.h version [222f4a0c5c].
Modified src/XMPPSCRAMAuth.h from [0cd4b1aae7] to [888f15c064].
︙ | |||
84 85 86 87 88 89 90 91 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + + + + + + | * \param hash The class to use for calulating hashes * \return A initialized XMPPSCRAMAuth */ - initWithAuthzid: (OFString*)authzid authcid: (OFString*)authcid password: (OFString*)password hash: (Class)hash; - (OFString*)XMPP_genNonce; - (uint8_t*)XMPP_HMACWithKey: (OFDataArray*)key data: (OFDataArray*)data; - (OFDataArray*)XMPP_hiWithData: (OFDataArray *)str salt: (OFDataArray *)salt_ iterationCount: (intmax_t)i; @end |
Modified src/XMPPSCRAMAuth.m from [0de8efa633] to [a71d5f22e6].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - - - - - - - - - | #define HMAC_IPAD 0x36 #define HMAC_OPAD 0x5c #ifndef HAVE_ARC4RANDOM_UNIFORM extern uint32_t arc4random_uniform(uint32_t); #endif |
︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | + + + - + + | size_t i; uint8_t *clientKey, *serverKey, *clientSignature; intmax_t iterCount; OFHash *hash; OFDataArray *ret, *authMessage, *tmpArray, *salt, *saltedPassword; OFString *tmpString, *sNonce; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFEnumerator *enumerator; OFString *comp; enum { GOT_SNONCE, GOT_SALT, GOT_ITERCOUNT } got = 0; hash = [[[hashType alloc] init] autorelease]; ret = [OFDataArray dataArrayWithItemSize: 1]; authMessage = [OFDataArray dataArrayWithItemSize: 1]; OFString *chal = [OFString stringWithCString: [challenge cArray] length: [challenge count] * [challenge itemSize]]; enumerator = |
︙ | |||
369 370 371 372 373 374 375 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | - + - + - + - + - + - + - + | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFDataArray *k = [OFDataArray dataArrayWithItemSize: 1]; size_t i, kSize, blockSize = [hashType blockSize]; uint8_t *kCArray, *kI = NULL, *kO = NULL; OFHash *hash; |
︙ |
Modified src/XMPPStanza.h from [b70c08218e] to [1377ddf174].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - - - - + + + + + + | @class XMPPJID; /** * \brief A class describing an XMPP Stanza. */ @interface XMPPStanza: OFXMLElement { |
︙ | |||
137 138 139 140 141 142 143 144 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | + + + + + + + + + | /** * Initializes an already allocated XMPPStanza based on a OFXMLElement * * \param elem The element to base the XMPPStanza on * \return A initialized XMPPStanza */ - initWithElement: (OFXMLElement*)elem; - (void)setFrom: (XMPPJID*)from; - (XMPPJID*)from; - (void)setTo: (XMPPJID*)to; - (XMPPJID*)to; - (void)setType: (OFString*)type; - (OFString*)type; - (void)setID: (OFString*)ID; - (OFString*)ID; @end |
Modified src/XMPPStanza.m from [9926f881b4] to [3e896b294c].
︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | - + - + - - + + + - - + + + + + + - + - + - + - + + | if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] && ![name_ isEqual: @"presence"]) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; [self setDefaultNamespace: @"jabber:client"]; |
︙ | |||
155 156 157 158 159 160 161 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + - + | from = [from_ copy]; [old release]; [self removeAttributeForName: @"from"]; if (from_ != nil) [self addAttributeWithName: @"from" |
︙ |
Modified tests/test.m from [fff72eb7c7] to [4765f2a59a].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + + + + - - + + - - + + - - + + - - - - + + + + + + + + - - + + - + - + - | #import "XMPPJID.h" #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" #import "XMPPRoster.h" |
︙ | |||
116 117 118 119 120 121 122 123 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | + + - - + + + - + | [conn requestRoster]; } - (void)connectionDidReceiveRoster :(XMPPConnection*)conn { XMPPPresence *pres; OFEnumerator *enumerator; OFString *group; |
︙ |