Overview
Comment: | Clean up the code. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e00e687561853a90b80b3537bccda323 |
User & Date: | js on 2011-02-16 20:05:14 |
Other Links: | manifest | tags |
Context
2011-02-16
| ||
20:05 | The full JID is the bare JID in case there's no resource. check-in: 219b0d5494 user: js tags: trunk | |
20:05 | Clean up the code. check-in: e00e687561 user: js tags: trunk | |
19:32 | Use one file per class. check-in: 28c341cb47 user: js tags: trunk | |
Changes
Modified src/XMPPConnection.h from [3f7778add9] to [9643929b2e].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 66 67 68 69 70 | - - - + + - + - - - + - - - - + - - - - + - - - - + - - - - + - - - - + - - - - + - - + - + - + - + | #import <ObjFW/ObjFW.h> |
Modified src/XMPPConnection.m from [4861f51dfb] to [ea49ed2a93].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | #include <assert.h> #include <stringprep.h> #import "XMPPConnection.h" #import "XMPPStanza.h" #import "XMPPJID.h" #import "XMPPIQ.h" #define NS_BIND @"urn:ietf:params:xml:ns:xmpp-bind" #define NS_CLIENT @"jabber:client" #define NS_SASL @"urn:ietf:params:xml:ns:xmpp-sasl" #define NS_STREAM @"http://etherx.jabber.org/streams" |
︙ | |||
51 52 53 54 55 56 57 | 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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - - + + - - + + - - + + - - + + | - (void)setUsername: (OFString*)username_ { OFString *old = username; char *node; Stringprep_rc rc; |
︙ | |||
141 142 143 144 145 146 147 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + + | @"version='1.0'>", server]; } - (void)connect { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ | |||
177 178 179 180 181 182 183 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | - + + - - + + + - + + + + | - (void)parser: (OFXMLParser*)p didStartElement: (OFString*)name withPrefix: (OFString*)prefix namespace: (OFString*)ns attributes: (OFArray*)attrs { if (![name isEqual: @"stream"] || ![prefix isEqual: @"stream"] || |
︙ | |||
240 241 242 243 244 245 246 247 248 249 250 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | + - + | [self sendStanza: iq]; } - (void)_handleResourceBind: (XMPPIQ*)iq { OFXMLElement *bindElem = iq.children.firstObject; if ([bindElem.name isEqual: @"bind"] && [bindElem.namespace isEqual: NS_BIND]) { OFXMLElement *jidElem = bindElem.children.firstObject; JID = [[XMPPJID alloc] initWithString: |
︙ | |||
298 299 300 301 302 303 304 | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | + + - + - | of_log(@"Auth failed!"); // FIXME: Handle! } if ([elem.name isEqual: @"iq"] && [elem.namespace isEqual: NS_CLIENT]) { XMPPIQ *iq = [XMPPIQ stanzaWithElement: elem]; // FIXME: More checking! |
Modified src/XMPPIQ.h from [c57efbd317] to [897d4b81a3].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + - + - + | #import "XMPPStanza.h" /** |
︙ |
Modified src/XMPPIQ.m from [a069c37422] to [5cc3a4abb8].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - + + + + - - + + | #import "XMPPIQ.h" @implementation XMPPIQ + IQWithType: (OFString*)type_ ID: (OFString*)ID_ { return [[[self alloc] initWithType: type_ ID: ID_] autorelease]; } - initWithType: (OFString*)type_ ID: (OFString*)ID_ { |
Modified src/XMPPJID.h from [ba250a7ca4] to [ac77d953dc].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 | - + - - + - - - - + - - - - + - - + - + - + - + - + | #import <ObjFW/ObjFW.h> /** |
Modified src/XMPPJID.m from [2fdab65477] to [31bd443101].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 | + + | #include <assert.h> #include <stringprep.h> #import "XMPPJID.h" @implementation XMPPJID @synthesize node; @synthesize domain; @synthesize resource; |
︙ | |||
21 22 23 24 25 26 27 | 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 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 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 | - - + + - - + + + + + + + + - - - + + + - + - - + + + + + + + + - + - + - + - + | { self = [super init]; size_t nodesep, resourcesep; nodesep = [str indexOfFirstOccurrenceOfString: @"@"]; resourcesep = [str indexOfFirstOccurrenceOfString: @"/"]; |
Modified src/XMPPMessage.h from [2b9ab347bf] to [3564ea1dbd].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 66 67 68 69 70 71 | - + - - - - + - + - + - + - + - + - + - + | #import "XMPPStanza.h" /** |
︙ |
Modified src/XMPPPresence.h from [9d51b71144] to [7a021bddee].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 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 | - + - - - - + - + - + - + - + - + - + - + - + - + - + | #import "XMPPStanza.h" /** |
Modified src/XMPPStanza.h from [aeb32fe0f4] to [f2881ecf2b].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 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 113 114 115 116 117 | - + - - + - - - - + - - - - + - - - - + - - + - + - + - + - + - + - + - + - + - + - + + - - + + | #import <ObjFW/ObjFW.h> /** |
︙ |
Modified src/XMPPStanza.m from [1421b4edb3] to [3a525ca278].
︙ | |||
61 62 63 64 65 66 67 | 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 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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - - - + + + + + - - - - - + + + + + + + + + + + + + - + + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - + + + + + + + - + + + + - + + + + - + + + + | ID: ID_]; } - initWithName: (OFString*)name_ type: (OFString*)type_ ID: (OFString*)ID_ { |
Modified tests/test.m from [2270757ce5] to [d49aed7d0d].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | + + + | #include <assert.h> #import <ObjFW/ObjFW.h> #import "XMPPConnection.h" #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" @interface AppDelegate: OFObject { XMPPConnection *conn; } @end |
︙ | |||
21 22 23 24 25 26 27 | 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 66 67 | - - - + + + - - - + + + - - + + - - + + | XMPPPresence *pres = [XMPPPresence presence]; [pres addShow: @"chat"]; [pres addStatus: @"Bored"]; [pres addPriority: 20]; pres.to = @"alice@example.com"; pres.from = @"bob@example.org"; assert([[pres stringValue] isEqual: @"<presence to='alice@example.com' " |
︙ |