Changeset 2401
- Timestamp:
- 03/05/05 17:16:59 (4 years ago)
- Files:
-
- trunk/Colloquy.xcode/project.pbxproj (modified) (2 diffs)
- trunk/JVChatConsolePanel.m (modified) (1 diff)
- trunk/JVChatController.m (modified) (1 diff)
- trunk/JVChatEvent.h (modified) (1 diff)
- trunk/JVChatEvent.m (modified) (8 diffs)
- trunk/JVChatMessage.m (modified) (5 diffs)
- trunk/JVChatRoomMember.m (modified) (2 diffs)
- trunk/JVChatSession.m (modified) (1 diff)
- trunk/JVChatTranscript.h (modified) (2 diffs)
- trunk/JVChatTranscript.m (modified) (29 diffs)
- trunk/JVChatTranscriptPanel.m (modified) (3 diffs)
- trunk/JVChatWindowController.m (modified) (5 diffs)
- trunk/JVStyle.m (modified) (3 diffs)
- trunk/MVApplicationController.m (modified) (2 diffs)
- trunk/MVChatConnection.h (modified) (1 diff)
- trunk/MVChatConnection.m (modified) (4 diffs)
- trunk/MVChatPluginManager.h (modified) (1 diff)
- trunk/MVChatPluginManager.m (modified) (2 diffs)
- trunk/MVChatRoom.h (modified) (1 diff)
- trunk/MVChatRoom.m (modified) (2 diffs)
- trunk/MVChatUser.h (modified) (1 diff)
- trunk/MVChatUser.m (modified) (2 diffs)
- trunk/MVIRCChatConnection.m (modified) (1 diff)
- trunk/MVSILCChatConnection.m (modified) (3 diffs)
- trunk/MVSILCChatRoom.m (modified) (1 diff)
- trunk/MVSILCChatUser.m (modified) (2 diffs)
- trunk/NSAttributedStringMoreAdditions.m (modified) (10 diffs)
- trunk/NSURLAdditions.m (modified) (3 diffs)
- trunk/Plug-Ins/AppleScript Support/JVAppleScriptChatPlugin.m (modified) (2 diffs)
- trunk/Plug-Ins/F-Script Support/JVFScriptChatPlugin.m (modified) (2 diffs)
- trunk/Resources/ChatCore.scriptSuite (modified) (7 diffs)
- trunk/Resources/ChatCore.scriptTerminology (modified) (5 diffs)
- trunk/Resources/ChatPlugIn.scriptSuite (modified) (9 diffs)
- trunk/Resources/ChatPlugIn.scriptTerminology (modified) (2 diffs)
- trunk/Resources/Colloquy.scriptSuite (modified) (13 diffs)
- trunk/Resources/Colloquy.scriptTerminology (modified) (10 diffs)
- trunk/Resources/Colloquy.sdef (modified) (27 diffs)
- trunk/Resources/Info.plist (modified) (1 diff)
- trunk/Resources/JVChatWindow.nib/info.nib (modified) (2 diffs)
- trunk/Resources/JVChatWindow.nib/keyedobjects.nib (modified) (previous)
- trunk/Resources/JVTabbedChatWindow.nib/info.nib (modified) (1 diff)
- trunk/Resources/JVTabbedChatWindow.nib/keyedobjects.nib (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Colloquy.xcode/project.pbxproj
r2398 r2401 2304 2304 1C0A4C9D0799BDB00093B702, 2305 2305 1C04394A07CAFCA000304949, 2306 1CD9DF6607D934F70006BB99,2307 2306 ); 2308 2307 isa = PBXResourcesBuildPhase; … … 4247 4246 sourceTree = "<group>"; 4248 4247 }; 4249 1CD9DF6607D934F70006BB99 = {4250 fileRef = 1CD9DF6507D934F70006BB99;4251 isa = PBXBuildFile;4252 settings = {4253 };4254 };4255 4248 1CDDCF830716208300FE11C3 = { 4256 4249 fileEncoding = 4; trunk/JVChatConsolePanel.m
r2320 r2401 589 589 return [NSNumber numberWithUnsignedInt:(unsigned long) self]; 590 590 } 591 592 - (NSWindow *) window { 593 return [[self windowController] window]; 594 } 591 595 @end trunk/JVChatController.m
r2399 r2401 451 451 @end 452 452 453 /* #pragma mark -454 455 @implementation JVChatWindowController (JVChatWindowControllerObjectSpecifier)456 - (NSScriptObjectSpecifier *) objectSpecifier {457 id classDescription = [NSClassDescription classDescriptionForClass:[JVChatController class]];458 NSScriptObjectSpecifier *container = [[JVChatController defaultManager] objectSpecifier];459 return [[[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:classDescription containerSpecifier:container key:@"chatWindows" uniqueID:[self uniqueIdentifier]] autorelease];460 }461 @end */462 463 453 #pragma mark - 464 454 trunk/JVChatEvent.h
r2308 r2401 34 34 /* xmlDoc */ void *_doc; 35 35 } 36 + (id) chatEventWithName:(NSString *) name andMessage:( NSString *) message;37 - (id) initWithName:(NSString *) name andMessage:( NSString *) message;36 + (id) chatEventWithName:(NSString *) name andMessage:(id) message; 37 - (id) initWithName:(NSString *) name andMessage:(id) message; 38 38 39 39 - (void) setDate:(NSDate *) date; trunk/JVChatEvent.m
r2308 r2401 36 36 37 37 @synchronized( [self transcript] ) { 38 xmlChar *prop = xmlGetProp( (xmlNode *) _node, "id" );39 _eventIdentifier = ( prop ? [[NSString allocWithZone:[self zone]] initWithUTF8String: prop] : nil );38 xmlChar *prop = xmlGetProp( (xmlNode *) _node, (xmlChar *) "id" ); 39 _eventIdentifier = ( prop ? [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop] : nil ); 40 40 xmlFree( prop ); 41 41 } … … 74 74 75 75 @synchronized( [self transcript] ) { 76 xmlChar *prop = xmlGetProp( (xmlNode *) _node, "name" );77 _name = ( prop ? [[NSString allocWithZone:[self zone]] initWithUTF8String: prop] : nil );76 xmlChar *prop = xmlGetProp( (xmlNode *) _node, (xmlChar *) "name" ); 77 _name = ( prop ? [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop] : nil ); 78 78 xmlFree( prop ); 79 79 80 prop = xmlGetProp( (xmlNode *) _node, "occurred" );81 _date = ( prop ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String: prop]] : nil );80 prop = xmlGetProp( (xmlNode *) _node, (xmlChar *) "occurred" ); 81 _date = ( prop ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String:(char *) prop]] : nil ); 82 82 xmlFree( prop ); 83 83 } … … 93 93 94 94 do { 95 if( subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 6 ) ) {95 if( subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 6 ) ) { 96 96 _message = [[NSTextStorage allocWithZone:[self zone]] initWithXHTMLTree:subNode baseURL:nil defaultAttributes:nil]; 97 97 break; … … 111 111 112 112 do { 113 if( subNode -> type == XML_ELEMENT_NODE && strncmp( "message", subNode -> name, 6 ) ) { // everything but "message"113 if( subNode -> type == XML_ELEMENT_NODE && strncmp( "message", (char *) subNode -> name, 6 ) ) { // everything but "message" 114 114 NSMutableDictionary *properties = [NSMutableDictionary dictionary]; 115 115 xmlAttrPtr prop = NULL; … … 117 117 xmlChar *value = xmlGetProp( subNode, prop -> name ); 118 118 if( value ) { 119 [properties setObject:[NSString stringWithUTF8String: value] forKey:[NSString stringWithUTF8String:prop -> name]];119 [properties setObject:[NSString stringWithUTF8String:(char *) value] forKey:[NSString stringWithUTF8String:(char *) prop -> name]]; 120 120 xmlFree( value ); 121 121 } … … 134 134 } else { 135 135 xmlChar *content = xmlNodeGetContent( subNode ); 136 value = [NSString stringWithUTF8String: content];136 value = [NSString stringWithUTF8String:(char *) content]; 137 137 xmlFree( content ); 138 138 } … … 140 140 if( [properties count] ) { 141 141 [properties setObject:value forKey:@"value"]; 142 [attributes setObject:properties forKey:[NSString stringWithUTF8String: subNode -> name]];142 [attributes setObject:properties forKey:[NSString stringWithUTF8String:(char *) subNode -> name]]; 143 143 } else { 144 [attributes setObject:value forKey:[NSString stringWithUTF8String: subNode -> name]];144 [attributes setObject:value forKey:[NSString stringWithUTF8String:(char *) subNode -> name]]; 145 145 } 146 146 } … … 249 249 if( ! _node ) { 250 250 if( _doc ) xmlFreeDoc( _doc ); 251 _doc = xmlNewDoc( "1.0" );252 253 xmlNodePtr root = xmlNewNode( NULL, "event" );254 xmlSetProp( root, "id",[[self eventIdentifier] UTF8String] );255 xmlSetProp( root, "name",[[self name] UTF8String] );256 xmlSetProp( root, "occurred",[[[self date] description] UTF8String] );251 _doc = xmlNewDoc( (xmlChar *) "1.0" ); 252 253 xmlNodePtr root = xmlNewNode( NULL, (xmlChar *) "event" ); 254 xmlSetProp( root, (xmlChar *) "id", (xmlChar *) [[self eventIdentifier] UTF8String] ); 255 xmlSetProp( root, (xmlChar *) "name", (xmlChar *) [[self name] UTF8String] ); 256 xmlSetProp( root, (xmlChar *) "occurred", (xmlChar *) [[[self date] description] UTF8String] ); 257 257 xmlDocSetRootElement( _doc, root ); 258 258 trunk/JVChatMessage.m
r2329 r2401 40 40 41 41 @synchronized( [self transcript] ) { 42 xmlChar *prop = xmlGetProp( _node, "received" );43 _date = ( prop ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String: prop]] : nil );42 xmlChar *prop = xmlGetProp( _node, (xmlChar *) "received" ); 43 _date = ( prop ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String:(char *) prop]] : nil ); 44 44 xmlFree( prop ); 45 45 46 prop = xmlGetProp( _node, "action" );47 _action = ( ( prop && ! strcmp( prop, "yes" ) ) ? YES : NO );46 prop = xmlGetProp( _node, (xmlChar *) "action" ); 47 _action = ( ( prop && ! strcmp( (char *) prop, "yes" ) ) ? YES : NO ); 48 48 xmlFree( prop ); 49 49 50 prop = xmlGetProp( _node, "highlight" );51 _highlighted = ( ( prop && ! strcmp( prop, "yes" ) ) ? YES : NO );50 prop = xmlGetProp( _node, (xmlChar *) "highlight" ); 51 _highlighted = ( ( prop && ! strcmp( (char *) prop, "yes" ) ) ? YES : NO ); 52 52 xmlFree( prop ); 53 53 54 prop = xmlGetProp( _node, "ignored" );55 _ignoreStatus = ( ( prop && ! strcmp( prop, "yes" ) ) ? JVMessageIgnored : _ignoreStatus );54 prop = xmlGetProp( _node, (xmlChar *) "ignored" ); 55 _ignoreStatus = ( ( prop && ! strcmp( (char *) prop, "yes" ) ) ? JVMessageIgnored : _ignoreStatus ); 56 56 xmlFree( prop ); 57 57 58 prop = xmlGetProp( _node, "type" );59 _type = ( ( prop && ! strcmp( prop, "notice" ) ) ? JVChatMessageNoticeType : JVChatMessageNormalType );58 prop = xmlGetProp( _node, (xmlChar *) "type" ); 59 _type = ( ( prop && ! strcmp( (char *) prop, "notice" ) ) ? JVChatMessageNoticeType : JVChatMessageNormalType ); 60 60 xmlFree( prop ); 61 61 62 prop = xmlGetProp( ((xmlNode *) _node) -> parent, "ignored" );63 _ignoreStatus = ( ( prop && ! strcmp( prop, "yes" ) ) ? JVUserIgnored : _ignoreStatus );62 prop = xmlGetProp( ((xmlNode *) _node) -> parent, (xmlChar *) "ignored" ); 63 _ignoreStatus = ( ( prop && ! strcmp( (char *) prop, "yes" ) ) ? JVUserIgnored : _ignoreStatus ); 64 64 xmlFree( prop ); 65 65 } … … 85 85 86 86 do { 87 if( subNode -> type == XML_ELEMENT_NODE && ! strncmp( "sender", subNode -> name, 6 ) ) {88 _senderName = [[NSString allocWithZone:[self zone]] initWithUTF8String: xmlNodeGetContent( subNode )];89 90 xmlChar *prop = xmlGetProp( subNode, "nickname" );91 if( prop ) _senderNickname = [[NSString allocWithZone:[self zone]] initWithUTF8String: prop];87 if( subNode -> type == XML_ELEMENT_NODE && ! strncmp( "sender", (char *) subNode -> name, 6 ) ) { 88 _senderName = [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) xmlNodeGetContent( subNode )]; 89 90 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "nickname" ); 91 if( prop ) _senderNickname = [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop]; 92 92 xmlFree( prop ); 93 93 94 prop = xmlGetProp( subNode, "identifier" );95 if( prop ) _senderIdentifier = [[NSString allocWithZone:[self zone]] initWithUTF8String: prop];94 prop = xmlGetProp( subNode, (xmlChar *) "identifier" ); 95 if( prop ) _senderIdentifier = [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop]; 96 96 xmlFree( prop ); 97 97 98 prop = xmlGetProp( subNode, "hostmask" );99 if( prop ) _senderHostmask = [[NSString allocWithZone:[self zone]] initWithUTF8String: prop];98 prop = xmlGetProp( subNode, (xmlChar *) "hostmask" ); 99 if( prop ) _senderHostmask = [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop]; 100 100 xmlFree( prop ); 101 101 102 prop = xmlGetProp( subNode, "class" );103 if( prop ) _senderClass = [[NSString allocWithZone:[self zone]] initWithUTF8String: prop];102 prop = xmlGetProp( subNode, (xmlChar *) "class" ); 103 if( prop ) _senderClass = [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) prop]; 104 104 xmlFree( prop ); 105 105 106 prop = xmlGetProp( subNode, "self" );107 if( prop && ! strcmp( prop, "yes" ) ) _senderIsLocalUser = YES;106 prop = xmlGetProp( subNode, (xmlChar *) "self" ); 107 if( prop && ! strcmp( (char *) prop, "yes" ) ) _senderIsLocalUser = YES; 108 108 else _senderIsLocalUser = NO; 109 109 xmlFree( prop ); … … 150 150 151 151 @synchronized( [self transcript] ) { 152 xmlChar *idStr = xmlGetProp( (xmlNode *) _node, "id" );153 _messageIdentifier = ( idStr ? [[NSString allocWithZone:[self zone]] initWithUTF8String: idStr] : nil );152 xmlChar *idStr = xmlGetProp( (xmlNode *) _node, (xmlChar *) "id" ); 153 _messageIdentifier = ( idStr ? [[NSString allocWithZone:[self zone]] initWithUTF8String:(char *) idStr] : nil ); 154 154 xmlFree( idStr ); 155 155 } … … 364 364 if( ! _node ) { 365 365 if( _doc ) xmlFreeDoc( _doc ); 366 _doc = xmlNewDoc( "1.0" );366 _doc = xmlNewDoc( (xmlChar *) "1.0" ); 367 367 368 368 xmlNodePtr child = NULL; 369 xmlNodePtr root = xmlNewNode( NULL, "envelope" );369 xmlNodePtr root = xmlNewNode( NULL, (xmlChar *) "envelope" ); 370 370 xmlDocSetRootElement( _doc, root ); 371 371 … … 390 390 391 391 _node = child = xmlDocCopyNode( xmlDocGetRootElement( msgDoc ), _doc, 1 ); 392 xmlSetProp( child, "id",[[self messageIdentifier] UTF8String] );393 xmlSetProp( child, "received",[[[self date] description] UTF8String] );394 if( [self isAction] ) xmlSetProp( child, "action","yes" );395 if( [self isHighlighted] ) xmlSetProp( child, "highlight","yes" );396 if( [self ignoreStatus] == JVMessageIgnored ) xmlSetProp( child, "ignored","yes" );397 else if( [self ignoreStatus] == JVUserIgnored ) xmlSetProp( root, "ignored","yes" );398 if( [self type] == JVChatMessageNoticeType ) xmlSetProp( child, "type","notice" );392 xmlSetProp( child, (xmlChar *) "id", (xmlChar *) [[self messageIdentifier] UTF8String] ); 393 xmlSetProp( child, (xmlChar *) "received", (xmlChar *) [[[self date] description] UTF8String] ); 394 if( [self isAction] ) xmlSetProp( child, (xmlChar *) "action", (xmlChar *) "yes" ); 395 if( [self isHighlighted] ) xmlSetProp( child, (xmlChar *) "highlight", (xmlChar *) "yes" ); 396 if( [self ignoreStatus] == JVMessageIgnored ) xmlSetProp( child, (xmlChar *) "ignored", (xmlChar *) "yes" ); 397 else if( [self ignoreStatus] == JVUserIgnored ) xmlSetProp( root, (xmlChar *) "ignored", (xmlChar *) "yes" ); 398 if( [self type] == JVChatMessageNoticeType ) xmlSetProp( child, (xmlChar *) "type", (xmlChar *) "notice" ); 399 399 xmlAddChild( root, child ); 400 400 trunk/JVChatRoomMember.m
r2308 r2401 695 695 } 696 696 697 #pragma mark -697 /*#pragma mark - 698 698 699 699 - (void) voiceScriptCommand:(NSScriptCommand *) command { … … 711 711 - (void) demoteScriptCommand:(NSScriptCommand *) command { 712 712 if( [self operator] ) [self toggleOperatorStatus:nil]; 713 } 713 } */ 714 714 @end trunk/JVChatSession.m
r2308 r2401 14 14 15 15 @synchronized( [self transcript] ) { 16 xmlChar *startedStr = xmlGetProp( (xmlNode *) _node, "started" );17 _startDate = ( startedStr ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String: startedStr]] : nil );16 xmlChar *startedStr = xmlGetProp( (xmlNode *) _node, (xmlChar *) "started" ); 17 _startDate = ( startedStr ? [[NSDate allocWithZone:[self zone]] initWithString:[NSString stringWithUTF8String:(char *) startedStr]] : nil ); 18 18 xmlFree( startedStr ); 19 19 } trunk/JVChatTranscript.h
r2308 r2401 10 10 11 11 @interface JVChatTranscript : NSObject { 12 NSScriptObjectSpecifier *_objectSpecifier; 12 13 void *_xmlLog; /* xmlDoc * */ 13 14 NSMutableArray *_messages; … … 85 86 - (BOOL) writeToFile:(NSString *) path atomically:(BOOL) useAuxiliaryFile; 86 87 - (BOOL) writeToURL:(NSURL *) url atomically:(BOOL) atomically; 88 89 - (void) setObjectSpecifier:(NSScriptObjectSpecifier *) objectSpecifier; 87 90 @end trunk/JVChatTranscript.m
r2345 r2401 89 89 _filePath = nil; 90 90 _logFile = nil; 91 _objectSpecifier = nil; 91 92 _autoWriteChanges = NO; 92 93 _requiresNewEnvelope = YES; … … 96 97 _messages = [[NSMutableArray allocWithZone:[self zone]] initWithCapacity:100]; 97 98 98 _xmlLog = xmlNewDoc( "1.0" );99 xmlDocSetRootElement( _xmlLog, xmlNewNode( NULL, "log" ) );100 xmlSetProp( xmlDocGetRootElement( _xmlLog ), "began",[[[NSDate date] description] UTF8String] );99 _xmlLog = xmlNewDoc( (xmlChar *) "1.0" ); 100 xmlDocSetRootElement( _xmlLog, xmlNewNode( NULL, (xmlChar *) "log" ) ); 101 xmlSetProp( xmlDocGetRootElement( _xmlLog ), (xmlChar *) "began", (xmlChar *) [[[NSDate date] description] UTF8String] ); 101 102 } 102 103 } … … 162 163 [_logFile release]; 163 164 [_messages release]; 165 [_objectSpecifier release]; 164 166 165 167 xmlFreeDoc( _xmlLog ); 166 168 169 _objectSpecifier = nil; 167 170 _filePath = nil; 168 171 _logFile = nil; … … 199 202 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 200 203 do { 201 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {204 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 202 205 xmlNode *subNode = node -> children; 203 206 do { 204 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) )207 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) 205 208 count++; 206 209 } while( subNode && ( subNode = subNode -> next ) ); … … 218 221 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 219 222 do { 220 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -> name, 7 ) )223 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", (char *) node -> name, 7 ) ) 221 224 count++; 222 225 } while( node && ( node = node -> next ) ); … … 232 235 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 233 236 do { 234 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {237 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 235 238 xmlNode *subNode = node -> children; 236 239 do { 237 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) )240 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) 238 241 count++; 239 242 } while( subNode && ( subNode = subNode -> next ) ); … … 251 254 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 252 255 do { 253 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", node -> name, 5 ) )256 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", (char *) node -> name, 5 ) ) 254 257 count++; 255 258 } while( node && ( node = node -> next ) ); … … 274 277 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 275 278 do { 276 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {279 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 277 280 xmlNode *subNode = node -> children; 278 281 do { 279 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) ) {282 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) { 280 283 if( NSLocationInRange( i, range ) ) { 281 284 JVChatMessage *msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; … … 286 289 } 287 290 } while( subNode && ( subNode = subNode -> next ) ); 288 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -> name, 7 ) ) {291 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", (char *) node -> name, 7 ) ) { 289 292 if( NSLocationInRange( i, range ) ) { 290 293 JVChatSession *session = [JVChatSession sessionWithNode:node andTranscript:self]; … … 293 296 294 297 if( ++i > ( range.location + range.length ) ) goto done; 295 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", node -> name, 5 ) ) {298 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", (char *) node -> name, 5 ) ) { 296 299 if( NSLocationInRange( i, range ) ) { 297 300 JVChatEvent *event = [JVChatEvent eventWithNode:node andTranscript:self]; … … 316 319 xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 317 320 do { 318 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {321 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 319 322 xmlNode *subNode = xmlGetLastChild( node ); 320 323 do { 321 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) )324 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) 322 325 return [JVChatMessage messageWithNode:subNode andTranscript:self]; 323 326 } while( subNode && ( subNode = subNode -> prev ) ); 324 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -> name, 7 ) ) {327 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", (char *) node -> name, 7 ) ) { 325 328 return [JVChatSession sessionWithNode:node andTranscript:self]; 326 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", node -> name, 5 ) ) {329 } else if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "event", (char *) node -> name, 5 ) ) { 327 330 return [JVChatEvent eventWithNode:node andTranscript:self]; 328 331 } … … 388 391 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 389 392 do { 390 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {393 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 391 394 xmlNode *subNode = node -> children; 392 395 do { 393 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) ) {396 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) { 394 397 if( NSLocationInRange( i, range ) ) { 395 398 if( [_messages count] > i && [[_messages objectAtIndex:i] isKindOfClass:[JVChatMessage class]] ) { … … 398 401 msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; 399 402 id classDesc = [NSClassDescription classDescriptionForClass:[self class]]; 400 [msg setObjectSpecifier:[[[NS IndexSpecifier alloc] initWithContainerClassDescription:classDesc containerSpecifier:[self objectSpecifier] key:@"messages" index:i] autorelease]];403 [msg setObjectSpecifier:[[[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:classDesc containerSpecifier:[self objectSpecifier] key:@"messages" uniqueID:[msg messageIdentifier]] autorelease]]; 401 404 [_messages replaceObjectAtIndex:i withObject:msg]; 402 405 } else if( [_messages count] == i ) { 403 406 msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; 404 407 id classDesc = [NSClassDescription classDescriptionForClass:[self class]]; 405 [msg setObjectSpecifier:[[[NS IndexSpecifier alloc] initWithContainerClassDescription:classDesc containerSpecifier:[self objectSpecifier] key:@"messages" index:i] autorelease]];408 [msg setObjectSpecifier:[[[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:classDesc containerSpecifier:[self objectSpecifier] key:@"messages" uniqueID:[msg messageIdentifier]] autorelease]]; 406 409 [_messages insertObject:msg atIndex:i]; 407 410 } else continue; … … 443 446 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 444 447 do { 445 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {448 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 446 449 xmlNode *subNode = node -> children; 447 450 do { 448 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) ) {449 xmlChar *prop = xmlGetProp( subNode, "id" );450 if( prop && ! strcmp( prop, ident ) ) foundNode = subNode;451 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) { 452 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "id" ); 453 if( prop && ! strcmp( (char *) prop, ident ) ) foundNode = subNode; 451 454 if( prop ) xmlFree( prop ); 452 455 if( foundNode ) break; … … 470 473 471 474 do { 472 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "message", node -> name, 7 ) ) {475 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) node -> name, 7 ) ) { 473 476 JVChatMessage *msg = [JVChatMessage messageWithNode:node andTranscript:self]; 474 477 if( msg ) [results addObject:msg]; … … 488 491 489 492 do { 490 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {493 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 491 494 xmlNode *subNode = xmlGetLastChild( node ); 492 495 do { 493 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) ) {496 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) { 494 497 foundNode = subNode; 495 498 break; … … 515 518 516 519 do { 517 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", node -> name, 8 ) ) {520 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) node -> name, 8 ) ) { 518 521 xmlNode *subNode = node -> children; 519 522 do { 520 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", subNode -> name, 7 ) ) {521 xmlChar *prop = xmlGetProp( subNode, "id" );522 if( prop && ! strcmp( prop, ident ) ) found = YES;523 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "message", (char *) subNode -> name, 7 ) ) { 524 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "id" ); 525 if( prop && ! strcmp( (char *) prop, ident ) ) found = YES; 523 526 if( prop ) xmlFree( prop ); 524 527 if( found ) return YES; … … 549 552 // check if the last node is an envelope by the same sender, if so append this message to that envelope 550 553 xmlNode *lastChild = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 551 if( lastChild && lastChild -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", lastChild -> name, 8 ) ) {554 if( lastChild && lastChild -> type == XML_ELEMENT_NODE && ! strncmp( "envelope", (char *) lastChild -> name, 8 ) ) { 552 555 xmlNode *subNode = lastChild -> children; 553 556 do { 554 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "sender", subNode -> name, 6 ) ) {557 if( subNode && subNode -> type == XML_ELEMENT_NODE && ! strncmp( "sender", (char *) subNode -> name, 6 ) ) { 555 558 NSString *identifier = [message senderIdentifier]; 556 559 NSString *nickname = [message senderNickname]; … … 558 561 559 562 xmlChar *senderNameStr = xmlNodeGetContent( subNode ); 560 NSString *senderName = [NSString stringWithUTF8String: senderNameStr];563 NSString *senderName = [NSString stringWithUTF8String:(char *) senderNameStr]; 561 564 xmlFree( senderNameStr ); 562 565 … … 564 567 NSString *senderIdentifier = nil; 565 568 566 xmlChar *prop = xmlGetProp( subNode, "nickname" );567 if( prop ) senderNickname = [NSString stringWithUTF8String: prop];569 xmlChar *prop = xmlGetProp( subNode, (xmlChar *) "nickname" ); 570 if( prop ) senderNickname = [NSString stringWithUTF8String:(char *) prop]; 568 571 xmlFree( prop ); 569 572 570 prop = xmlGetProp( subNode, "identifier" );571 if( prop ) senderIdentifier = [NSString stringWithUTF8String: prop];573 prop = xmlGetProp( subNode, (xmlChar *) "identifier" ); 574 if( prop ) senderIdentifier = [NSString stringWithUTF8String:(char *) prop]; 572 575 xmlFree( prop ); 573 576 … … 582 585 583 586 if( ! parent ) { // make a new envelope to append 584 root = xmlNewNode( NULL, "envelope" );587 root = xmlNewNode( NULL, (xmlChar *) "envelope" ); 585 588 root = xmlAddChild( xmlDocGetRootElement( _xmlLog ), root ); 586 589 587 590 if( [message ignoreStatus] == JVUserIgnored ) 588 xmlSetProp( root, "ignored","yes" );591 xmlSetProp( root, (xmlChar *) "ignored", (xmlChar *) "yes" ); 589 592 590 593 xmlNode *subNode = ((xmlNode *) [message node]) -> parent -> children; 591 594 592 595 do { 593 if( ! strncmp( "sender", subNode -> name, 6 ) ) break;596 if( ! strncmp( "sender", (char *) subNode -> name, 6 ) ) break; 594 597 } while( subNode && ( subNode = subNode -> next ) ); 595 598 … … 650 653 xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 651 654 do { 652 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -> name, 7 ) ) {655 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", (char *) node -> name, 7 ) ) { 653 656 if( NSLocationInRange( i, range ) ) { 654 657 JVChatSession *session = [JVChatSession sessionWithNode:node andTranscript:self]; … … 673 676 xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 674 677 do { 675 if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -&g
