Changeset 3345
- Timestamp:
- 08/27/06 18:33:11 (2 years ago)
- Files:
-
- trunk/Models/JVChatEvent.m (modified) (2 diffs)
- trunk/Models/JVChatTranscript.m (modified) (25 diffs)
- trunk/Models/JVSQLChatTranscript.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Models/JVChatEvent.m
r3247 r3345 52 52 53 53 do { 54 if( subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 6) ) {54 if( subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 55 55 _message = [[NSTextStorage allocWithZone:[self zone]] initWithXHTMLTree:subNode baseURL:nil defaultAttributes:nil]; 56 56 break; … … 70 70 71 71 do { 72 if( subNode -> type == XML_ELEMENT_NODE && str ncmp( "message", (char *) subNode -> name, 6) ) { // everything but "message"72 if( subNode -> type == XML_ELEMENT_NODE && strcmp( "message", (char *) subNode -> name ) ) { // everything but "message" 73 73 NSMutableDictionary *properties = [NSMutableDictionary dictionary]; 74 74 xmlAttrPtr prop = NULL; trunk/Models/JVChatTranscript.m
r3259 r3345 204 204 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 205 205 do { 206 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {206 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 207 207 xmlNode *subNode = node -> children; 208 208 do { 209 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) )209 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) 210 210 count++; 211 211 } while( subNode && ( subNode = subNode -> next ) ); … … 223 223 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 224 224 do { 225 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) )225 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) 226 226 count++; 227 227 } while( node && ( node = node -> next ) ); … … 237 237 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 238 238 do { 239 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {239 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 240 240 xmlNode *subNode = node -> children; 241 241 do { 242 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) )242 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) 243 243 count++; 244 244 } while( subNode && ( subNode = subNode -> next ) ); … … 256 256 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 257 257 do { 258 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) )258 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) 259 259 count++; 260 260 } while( node && ( node = node -> next ) ); … … 290 290 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 291 291 do { 292 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {292 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 293 293 xmlNode *subNode = node -> children; 294 294 do { 295 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {295 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 296 296 if( NSLocationInRange( i, range ) ) { 297 297 JVChatMessage *msg = [[JVChatMessage allocWithZone:nil] _initWithNode:subNode andTranscript:self]; … … 303 303 } 304 304 } while( subNode && ( subNode = subNode -> next ) ); 305 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) ) {305 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) { 306 306 if( NSLocationInRange( i, range ) ) { 307 307 JVChatSession *session = [[JVChatSession allocWithZone:nil] _initWithNode:node andTranscript:self]; … … 311 311 312 312 if( ++i > ( range.location + range.length ) ) goto done; 313 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) ) {313 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) { 314 314 if( NSLocationInRange( i, range ) ) { 315 315 JVChatEvent *event = [[JVChatEvent allocWithZone:nil] _initWithNode:node andTranscript:self]; … … 335 335 xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 336 336 do { 337 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {337 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 338 338 xmlNode *subNode = xmlGetLastChild( node ); 339 339 do { 340 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) )340 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) 341 341 return [[[JVChatMessage allocWithZone:nil] _initWithNode:subNode andTranscript:self] autorelease]; 342 342 } while( subNode && ( subNode = subNode -> prev ) ); 343 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) ) {343 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) { 344 344 return [[[JVChatSession allocWithZone:nil] _initWithNode:node andTranscript:self] autorelease]; 345 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) ) {345 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) { 346 346 return [[[JVChatEvent allocWithZone:nil] _initWithNode:node andTranscript:self] autorelease]; 347 347 } … … 405 405 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 406 406 do { 407 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {407 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 408 408 xmlNode *subNode = node -> children; 409 409 do { 410 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {410 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 411 411 if( NSLocationInRange( i, range ) ) { 412 412 if( [_messages count] > i && [[_messages objectAtIndex:i] isKindOfClass:[JVChatMessage class]] ) { … … 463 463 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 464 464 do { 465 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {465 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 466 466 xmlNode *subNode = node -> children; 467 467 do { 468 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {468 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 469 469 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "id" ); 470 470 if( prop && ! strcmp( (char *) prop, ident ) ) foundNode = subNode; … … 486 486 487 487 do { 488 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {488 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 489 489 xmlNode *subNode = xmlGetLastChild( node ); 490 490 do { 491 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {491 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 492 492 foundNode = subNode; 493 493 break; … … 513 513 514 514 do { 515 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {515 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 516 516 xmlNode *subNode = node -> children; 517 517 do { 518 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {518 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 519 519 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "id" ); 520 520 if( prop && ! strcmp( (char *) prop, ident ) ) found = YES; … … 547 547 // check if the last node is an envelope by the same sender (and maybe source), if so append this message to that envelope 548 548 xmlNode *lastChild = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 549 if( lastChild && lastChild -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) lastChild -> name, 8) ) {549 if( lastChild && lastChild -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) lastChild -> name ) ) { 550 550 NSString *msgSource = [[message source] absoluteString]; 551 551 … … 557 557 xmlNode *subNode = lastChild -> children; 558 558 do { 559 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "sender", (char *) subNode -> name, 6) ) {559 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "sender", (char *) subNode -> name ) ) { 560 560 NSString *identifier = [message senderIdentifier]; 561 561 NSString *nickname = [message senderNickname]; … … 599 599 600 600 do { 601 if( ! str ncmp( "sender", (char *) subNode -> name, 6) ) break;601 if( ! strcmp( "sender", (char *) subNode -> name ) ) break; 602 602 } while( subNode && ( subNode = subNode -> next ) ); 603 603 … … 664 664 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 665 665 do { 666 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) ) {666 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) { 667 667 if( NSLocationInRange( i, range ) ) { 668 668 JVChatSession *session = [[JVChatSession allocWithZone:nil] _initWithNode:node andTranscript:self]; … … 688 688 xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 689 689 do { 690 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) )690 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) 691 691 return [[[JVChatSession allocWithZone:nil] _initWithNode:node andTranscript:self] autorelease]; 692 692 } while( node && ( node = node -> prev ) ); … … 729 729 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 730 730 do { 731 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) ) {731 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) { 732 732 if( NSLocationInRange( i, range ) ) { 733 733 JVChatEvent *event = [[JVChatEvent allocWithZone:nil] _initWithNode:node andTranscript:self]; … … 753 753 xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 754 754 do { 755 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) )755 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) 756 756 return [[[JVChatEvent allocWithZone:nil] _initWithNode:node andTranscript:self] autorelease]; 757 757 } while( node && ( node = node -> prev ) ); … … 773 773 774 774 do { 775 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) ) {775 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) { 776 776 xmlChar *prop = xmlGetProp( node, (xmlChar *) "id" ); 777 777 if( prop && ! strcmp( (char *) prop, ident ) ) found = YES; … … 978 978 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 979 979 do { 980 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "envelope", (char *) node -> name, 8) ) {980 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "envelope", (char *) node -> name ) ) { 981 981 xmlNode *subNode = node -> children; 982 982 BOOL removedAllMessages = YES; 983 983 984 984 do { 985 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) subNode -> name, 7) ) {985 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) subNode -> name ) ) { 986 986 if( total > 0 ) { 987 987 tmp = subNode -> prev; … … 1004 1004 node = ( tmp ? tmp : xmlDocGetRootElement( _xmlLog ) -> children ); 1005 1005 } 1006 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "session", (char *) node -> name, 7) ) {1006 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "session", (char *) node -> name ) ) { 1007 1007 tmp = node -> prev; 1008 1008 xmlUnlinkNode( node ); … … 1010 1010 node = ( tmp ? tmp : xmlDocGetRootElement( _xmlLog ) -> children ); 1011 1011 total--; 1012 } else if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "event", (char *) node -> name, 5) ) {1012 } else if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "event", (char *) node -> name ) ) { 1013 1013 tmp = node -> prev; 1014 1014 xmlUnlinkNode( node ); … … 1339 1339 1340 1340 do { 1341 if( node && node -> type == XML_ELEMENT_NODE && ! str ncmp( "message", (char *) node -> name, 7) ) {1341 if( node && node -> type == XML_ELEMENT_NODE && ! strcmp( "message", (char *) node -> name ) ) { 1342 1342 if( node == _node ) break; 1343 1343 _consecutiveOffset++; … … 1356 1356 1357 1357 do { 1358 if( subNode -> type == XML_ELEMENT_NODE && ! str ncmp( "sender", (char *) subNode -> name, 6) ) {1358 if( subNode -> type == XML_ELEMENT_NODE && ! strcmp( "sender", (char *) subNode -> name ) ) { 1359 1359 xmlChar *prop = xmlNodeGetContent( subNode ); 1360 1360 id old = _senderName; trunk/Models/JVSQLChatTranscript.m
r3259 r3345 187 187 NSString *identifier = [[NSString allocWithZone:nil] initWithUTF8String:fields[1]]; 188 188 189 if( ! str ncmp( "message", fields[0], 7) ) {189 if( ! strcmp( "message", fields[0] ) ) { 190 190 JVChatMessage *message = [[JVChatMessage allocWithZone:nil] _initWithSQLIdentifier:identifier andTranscript:data -> transcript]; 191 191 if( message ) [data -> results addObject:message]; 192 192 [message release]; 193 } else if( ! str ncmp( "event", fields[0], 5) ) {193 } else if( ! strcmp( "event", fields[0] ) ) { 194 194 JVChatEvent *event = [[JVChatEvent allocWithZone:nil] _initWithSQLIdentifier:identifier andTranscript:data -> transcript]; 195 195 if( event ) [data -> results addObject:event];
