Changeset 2401

Show
Ignore:
Timestamp:
03/05/05 17:16:59 (4 years ago)
Author:
timothy
Message:

Many changes mostly related to AppleScripting.

  • Scripting should be mostly restored now. The iTunes script fully functions, and the most common scripts should.
  • Many Chat Core level scripting things have been reworked and will not be backwards compat.
  • Some Colloquy level scripting commands are missing awaiting better counterparts.
  • Fixes all the remaining Tiger GCC 4 "differ in signedness" compile warnings.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Colloquy.xcode/project.pbxproj

    r2398 r2401  
    23042304                                1C0A4C9D0799BDB00093B702, 
    23052305                                1C04394A07CAFCA000304949, 
    2306                                 1CD9DF6607D934F70006BB99, 
    23072306                        ); 
    23082307                        isa = PBXResourcesBuildPhase; 
     
    42474246                        sourceTree = "<group>"; 
    42484247                }; 
    4249                 1CD9DF6607D934F70006BB99 = { 
    4250                         fileRef = 1CD9DF6507D934F70006BB99; 
    4251                         isa = PBXBuildFile; 
    4252                         settings = { 
    4253                         }; 
    4254                 }; 
    42554248                1CDDCF830716208300FE11C3 = { 
    42564249                        fileEncoding = 4; 
  • trunk/JVChatConsolePanel.m

    r2320 r2401  
    589589        return [NSNumber numberWithUnsignedInt:(unsigned long) self]; 
    590590} 
     591 
     592- (NSWindow *) window { 
     593        return [[self windowController] window]; 
     594} 
    591595@end 
  • trunk/JVChatController.m

    r2399 r2401  
    451451@end 
    452452 
    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  
    463453#pragma mark - 
    464454 
  • trunk/JVChatEvent.h

    r2308 r2401  
    3434        /* xmlDoc */ void *_doc; 
    3535} 
    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; 
    3838 
    3939- (void) setDate:(NSDate *) date; 
  • trunk/JVChatEvent.m

    r2308 r2401  
    3636 
    3737                @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 ); 
    4040                        xmlFree( prop ); 
    4141                } 
     
    7474 
    7575        @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 ); 
    7878                xmlFree( prop ); 
    7979 
    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 ); 
    8282                xmlFree( prop ); 
    8383        } 
     
    9393 
    9494                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 ) ) { 
    9696                                _message = [[NSTextStorage allocWithZone:[self zone]] initWithXHTMLTree:subNode baseURL:nil defaultAttributes:nil]; 
    9797                                break; 
     
    111111 
    112112                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" 
    114114                                NSMutableDictionary *properties = [NSMutableDictionary dictionary]; 
    115115                                xmlAttrPtr prop = NULL; 
     
    117117                                        xmlChar *value = xmlGetProp( subNode, prop -> name ); 
    118118                                        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]]; 
    120120                                                xmlFree( value ); 
    121121                                        } 
     
    134134                                } else { 
    135135                                        xmlChar *content = xmlNodeGetContent( subNode ); 
    136                                         value = [NSString stringWithUTF8String:content]; 
     136                                        value = [NSString stringWithUTF8String:(char *) content]; 
    137137                                        xmlFree( content ); 
    138138                                } 
     
    140140                                if( [properties count] ) { 
    141141                                        [properties setObject:value forKey:@"value"]; 
    142                                         [attributes setObject:properties forKey:[NSString stringWithUTF8String:subNode -> name]]; 
     142                                        [attributes setObject:properties forKey:[NSString stringWithUTF8String:(char *) subNode -> name]]; 
    143143                                } else { 
    144                                         [attributes setObject:value forKey:[NSString stringWithUTF8String:subNode -> name]]; 
     144                                        [attributes setObject:value forKey:[NSString stringWithUTF8String:(char *) subNode -> name]]; 
    145145                                } 
    146146                        } 
     
    249249        if( ! _node ) { 
    250250                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] ); 
    257257                xmlDocSetRootElement( _doc, root ); 
    258258 
  • trunk/JVChatMessage.m

    r2329 r2401  
    4040 
    4141        @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 ); 
    4444                xmlFree( prop ); 
    4545 
    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 ); 
    4848                xmlFree( prop ); 
    4949 
    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 ); 
    5252                xmlFree( prop ); 
    5353 
    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 ); 
    5656                xmlFree( prop ); 
    5757 
    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 ); 
    6060                xmlFree( prop ); 
    6161 
    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 ); 
    6464                xmlFree( prop ); 
    6565        } 
     
    8585 
    8686                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]; 
    9292                                xmlFree( prop ); 
    9393 
    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]; 
    9696                                xmlFree( prop ); 
    9797 
    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]; 
    100100                                xmlFree( prop ); 
    101101 
    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]; 
    104104                                xmlFree( prop ); 
    105105 
    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; 
    108108                                else _senderIsLocalUser = NO; 
    109109                                xmlFree( prop ); 
     
    150150 
    151151                @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 ); 
    154154                        xmlFree( idStr ); 
    155155                } 
     
    364364        if( ! _node ) { 
    365365                if( _doc ) xmlFreeDoc( _doc ); 
    366                 _doc = xmlNewDoc( "1.0" ); 
     366                _doc = xmlNewDoc( (xmlChar *) "1.0" ); 
    367367 
    368368                xmlNodePtr child = NULL; 
    369                 xmlNodePtr root = xmlNewNode( NULL, "envelope" ); 
     369                xmlNodePtr root = xmlNewNode( NULL, (xmlChar *) "envelope" ); 
    370370                xmlDocSetRootElement( _doc, root ); 
    371371 
     
    390390 
    391391                _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" ); 
    399399                xmlAddChild( root, child ); 
    400400 
  • trunk/JVChatRoomMember.m

    r2308 r2401  
    695695} 
    696696 
    697 #pragma mark - 
     697/*#pragma mark - 
    698698 
    699699- (void) voiceScriptCommand:(NSScriptCommand *) command { 
     
    711711- (void) demoteScriptCommand:(NSScriptCommand *) command { 
    712712        if( [self operator] ) [self toggleOperatorStatus:nil]; 
    713 } 
     713} */ 
    714714@end 
  • trunk/JVChatSession.m

    r2308 r2401  
    1414 
    1515                @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 ); 
    1818                        xmlFree( startedStr ); 
    1919                } 
  • trunk/JVChatTranscript.h

    r2308 r2401  
    1010 
    1111@interface JVChatTranscript : NSObject { 
     12        NSScriptObjectSpecifier *_objectSpecifier; 
    1213        void *_xmlLog; /* xmlDoc * */ 
    1314        NSMutableArray *_messages; 
     
    8586- (BOOL) writeToFile:(NSString *) path atomically:(BOOL) useAuxiliaryFile; 
    8687- (BOOL) writeToURL:(NSURL *) url atomically:(BOOL) atomically; 
     88 
     89- (void) setObjectSpecifier:(NSScriptObjectSpecifier *) objectSpecifier; 
    8790@end 
  • trunk/JVChatTranscript.m

    r2345 r2401  
    8989                _filePath = nil; 
    9090                _logFile = nil; 
     91                _objectSpecifier = nil; 
    9192                _autoWriteChanges = NO; 
    9293                _requiresNewEnvelope = YES; 
     
    9697                        _messages = [[NSMutableArray allocWithZone:[self zone]] initWithCapacity:100]; 
    9798 
    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] ); 
    101102                } 
    102103        } 
     
    162163        [_logFile release]; 
    163164        [_messages release]; 
     165        [_objectSpecifier release]; 
    164166 
    165167        xmlFreeDoc( _xmlLog ); 
    166168 
     169        _objectSpecifier = nil; 
    167170        _filePath = nil; 
    168171        _logFile = nil; 
     
    199202                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    200203                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 ) ) { 
    202205                                xmlNode *subNode = node -> children; 
    203206                                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 ) ) 
    205208                                                count++; 
    206209                                } while( subNode && ( subNode = subNode -> next ) );  
     
    218221                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    219222                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 ) ) 
    221224                                count++; 
    222225                } while( node && ( node = node -> next ) ); 
     
    232235                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    233236                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 ) ) { 
    235238                                xmlNode *subNode = node -> children; 
    236239                                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 ) ) 
    238241                                                count++; 
    239242                                } while( subNode && ( subNode = subNode -> next ) );  
     
    251254                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    252255                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 ) ) 
    254257                                count++; 
    255258                } while( node && ( node = node -> next ) ); 
     
    274277                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    275278                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 ) ) { 
    277280                                xmlNode *subNode = node -> children; 
    278281                                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 ) ) { 
    280283                                                if( NSLocationInRange( i, range ) ) { 
    281284                                                        JVChatMessage *msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; 
     
    286289                                        } 
    287290                                } 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 ) ) { 
    289292                                if( NSLocationInRange( i, range ) ) { 
    290293                                        JVChatSession *session = [JVChatSession sessionWithNode:node andTranscript:self]; 
     
    293296 
    294297                                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 ) ) { 
    296299                                if( NSLocationInRange( i, range ) ) { 
    297300                                        JVChatEvent *event = [JVChatEvent eventWithNode:node andTranscript:self]; 
     
    316319                xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 
    317320                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 ) ) { 
    319322                                xmlNode *subNode = xmlGetLastChild( node ); 
    320323                                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 ) ) 
    322325                                                return [JVChatMessage messageWithNode:subNode andTranscript:self]; 
    323326                                } 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 ) ) { 
    325328                                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 ) ) { 
    327330                                return [JVChatEvent eventWithNode:node andTranscript:self]; 
    328331                        } 
     
    388391                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    389392                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 ) ) { 
    391394                                xmlNode *subNode = node -> children; 
    392395                                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 ) ) { 
    394397                                                if( NSLocationInRange( i, range ) ) { 
    395398                                                        if( [_messages count] > i && [[_messages objectAtIndex:i] isKindOfClass:[JVChatMessage class]] ) { 
     
    398401                                                                msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; 
    399402                                                                id classDesc = [NSClassDescription classDescriptionForClass:[self class]]; 
    400                                                                 [msg setObjectSpecifier:[[[NSIndexSpecifier 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]]; 
    401404                                                                [_messages replaceObjectAtIndex:i withObject:msg]; 
    402405                                                        } else if( [_messages count] == i ) { 
    403406                                                                msg = [JVChatMessage messageWithNode:subNode andTranscript:self]; 
    404407                                                                id classDesc = [NSClassDescription classDescriptionForClass:[self class]]; 
    405                                                                 [msg setObjectSpecifier:[[[NSIndexSpecifier 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]]; 
    406409                                                                [_messages insertObject:msg atIndex:i]; 
    407410                                                        } else continue; 
     
    443446                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    444447                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 ) ) { 
    446449                                xmlNode *subNode = node -> children; 
    447450                                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; 
    451454                                                if( prop ) xmlFree( prop ); 
    452455                                                if( foundNode ) break; 
     
    470473 
    471474                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 ) ) { 
    473476                                JVChatMessage *msg = [JVChatMessage messageWithNode:node andTranscript:self]; 
    474477                                if( msg ) [results addObject:msg]; 
     
    488491 
    489492                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 ) ) { 
    491494                                xmlNode *subNode = xmlGetLastChild( node ); 
    492495                                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 ) ) { 
    494497                                                foundNode = subNode; 
    495498                                                break; 
     
    515518 
    516519                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 ) ) { 
    518521                                xmlNode *subNode = node -> children; 
    519522                                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; 
    523526                                                if( prop ) xmlFree( prop ); 
    524527                                                if( found ) return YES; 
     
    549552                        // check if the last node is an envelope by the same sender, if so append this message to that envelope 
    550553                        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 ) ) { 
    552555                                xmlNode *subNode = lastChild -> children; 
    553556                                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 ) ) { 
    555558                                                NSString *identifier = [message senderIdentifier]; 
    556559                                                NSString *nickname = [message senderNickname]; 
     
    558561 
    559562                                                xmlChar *senderNameStr = xmlNodeGetContent( subNode ); 
    560                                                 NSString *senderName = [NSString stringWithUTF8String:senderNameStr]; 
     563                                                NSString *senderName = [NSString stringWithUTF8String:(char *) senderNameStr]; 
    561564                                                xmlFree( senderNameStr ); 
    562565 
     
    564567                                                NSString *senderIdentifier = nil; 
    565568 
    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]; 
    568571                                                xmlFree( prop ); 
    569572 
    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]; 
    572575                                                xmlFree( prop ); 
    573576 
     
    582585 
    583586                if( ! parent ) { // make a new envelope to append 
    584                         root = xmlNewNode( NULL, "envelope" ); 
     587                        root = xmlNewNode( NULL, (xmlChar *) "envelope" ); 
    585588                        root = xmlAddChild( xmlDocGetRootElement( _xmlLog ), root ); 
    586589 
    587590                        if( [message ignoreStatus] == JVUserIgnored ) 
    588                                 xmlSetProp( root, "ignored", "yes" ); 
     591                                xmlSetProp( root, (xmlChar *) "ignored", (xmlChar *) "yes" ); 
    589592 
    590593                        xmlNode *subNode = ((xmlNode *) [message node]) -> parent -> children; 
    591594 
    592595                        do { 
    593                                 if( ! strncmp( "sender", subNode -> name, 6 ) ) break; 
     596                                if( ! strncmp( "sender", (char *) subNode -> name, 6 ) ) break; 
    594597                        } while( subNode && ( subNode = subNode -> next ) );  
    595598 
     
    650653                xmlNode *node = xmlDocGetRootElement( _xmlLog ) -> children; 
    651654                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 ) ) { 
    653656                                if( NSLocationInRange( i, range ) ) { 
    654657                                        JVChatSession *session = [JVChatSession sessionWithNode:node andTranscript:self]; 
     
    673676                xmlNode *node = xmlGetLastChild( xmlDocGetRootElement( _xmlLog ) ); 
    674677                do { 
    675                         if( node && node -> type == XML_ELEMENT_NODE && ! strncmp( "session", node -&g