Changeset 1869

Show
Ignore:
Timestamp:
09/16/04 20:16:30 (4 years ago)
Author:
timothy
Message:

SILC added as our second supported chat protocol! Thanks to patw (Patrik Weiskircher).
* There is no GUI to make a SILC connection yet. To make a connection ask xenon.
* File transfers and other special features of SILC arn't implemented yet, just chatting and the things that go along with chatting.

Files:

Legend:

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

    r1862 r1869  
    117117                                1058C7ADFEA557BF11CA2CBB, 
    118118                                1CCB3C3705228EFD000001C8, 
     119                                1C5A233D06FA4FEE00A51F10, 
     120                                1C5A233E06FA4FEE00A51F10, 
    119121                        ); 
    120122                        isa = PBXGroup; 
     
    270272                                DYLIB_COMPATIBILITY_VERSION = 1; 
    271273                                DYLIB_CURRENT_VERSION = 1; 
     274                                FRAMEWORK_SEARCH_PATHS = /Users/Timothy/Projects/Colloquy/Frameworks; 
    272275                                FRAMEWORK_VERSION = A; 
    273276                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     
    346349                                1CF4E5120698E9E900986498, 
    347350                                1C5A1A2506F8F4A000A51F10, 
     351                                1C5A230A06FA4F2800A51F10, 
    348352                        ); 
    349353                        isa = PBXSourcesBuildPhase; 
     
    371375                                1CA66045060EAEF3008FCC95, 
    372376                                1CA66049060EAF05008FCC95, 
     377                                1C5A233F06FA4FEE00A51F10, 
     378                                1C5A234006FA4FEE00A51F10, 
    373379                        ); 
    374380                        isa = PBXFrameworksBuildPhase; 
     
    421427                1C5A1A2506F8F4A000A51F10 = { 
    422428                        fileRef = 1C5A1A2306F8F4A000A51F10; 
     429                        isa = PBXBuildFile; 
     430                        settings = { 
     431                        }; 
     432                }; 
     433                1C5A230706FA4F2700A51F10 = { 
     434                        fileEncoding = 4; 
     435                        isa = PBXFileReference; 
     436                        lastKnownFileType = sourcecode.c.h; 
     437                        path = MVSILCChatConnection.h; 
     438                        refType = 4; 
     439                        sourceTree = "<group>"; 
     440                }; 
     441                1C5A230806FA4F2700A51F10 = { 
     442                        fileEncoding = 4; 
     443                        isa = PBXFileReference; 
     444                        lastKnownFileType = sourcecode.c.objc; 
     445                        path = MVSILCChatConnection.m; 
     446                        refType = 4; 
     447                        sourceTree = "<group>"; 
     448                }; 
     449                1C5A230A06FA4F2800A51F10 = { 
     450                        fileRef = 1C5A230806FA4F2700A51F10; 
     451                        isa = PBXBuildFile; 
     452                        settings = { 
     453                        }; 
     454                }; 
     455                1C5A233D06FA4FEE00A51F10 = { 
     456                        isa = PBXFileReference; 
     457                        lastKnownFileType = wrapper.framework; 
     458                        name = libsilc.framework; 
     459                        path = Frameworks/libsilc.framework; 
     460                        refType = 4; 
     461                        sourceTree = "<group>"; 
     462                }; 
     463                1C5A233E06FA4FEE00A51F10 = { 
     464                        isa = PBXFileReference; 
     465                        lastKnownFileType = wrapper.framework; 
     466                        name = libsilcclient.framework; 
     467                        path = Frameworks/libsilcclient.framework; 
     468                        refType = 4; 
     469                        sourceTree = "<group>"; 
     470                }; 
     471                1C5A233F06FA4FEE00A51F10 = { 
     472                        fileRef = 1C5A233D06FA4FEE00A51F10; 
     473                        isa = PBXBuildFile; 
     474                        settings = { 
     475                        }; 
     476                }; 
     477                1C5A234006FA4FEE00A51F10 = { 
     478                        fileRef = 1C5A233E06FA4FEE00A51F10; 
    423479                        isa = PBXBuildFile; 
    424480                        settings = { 
     
    32633319                                1C5A1A2306F8F4A000A51F10, 
    32643320                                1C5A1A2206F8F4A000A51F10, 
     3321                                1C5A230806FA4F2700A51F10, 
     3322                                1C5A230706FA4F2700A51F10, 
    32653323                                1C943AAA063C260800618CD9, 
    32663324                                1C943AA9063C260800618CD9, 
  • trunk/Colloquy.xcode/project.pbxproj

    r1862 r1869  
    196196                                1C7055CA0519E56C00A8FE6E, 
    197197                                1C7055C40519E54C00A8FE6E, 
     198                                1C5A249106FA6AAA00A51F10, 
     199                                1C5A249206FA6AAA00A51F10, 
    198200                        ); 
    199201                        isa = PBXGroup; 
     
    11291131                        sourceTree = "<group>"; 
    11301132                }; 
     1133                1C5A232006FA4FC000A51F10 = { 
     1134                        fileEncoding = 4; 
     1135                        isa = PBXFileReference; 
     1136                        lastKnownFileType = sourcecode.c.h; 
     1137                        path = MVSILCChatConnection.h; 
     1138                        refType = 4; 
     1139                        sourceTree = "<group>"; 
     1140                }; 
     1141                1C5A232106FA4FC000A51F10 = { 
     1142                        fileEncoding = 4; 
     1143                        isa = PBXFileReference; 
     1144                        lastKnownFileType = sourcecode.c.objc; 
     1145                        path = MVSILCChatConnection.m; 
     1146                        refType = 4; 
     1147                        sourceTree = "<group>"; 
     1148                }; 
     1149                1C5A249106FA6AAA00A51F10 = { 
     1150                        isa = PBXFileReference; 
     1151                        lastKnownFileType = wrapper.framework; 
     1152                        name = libsilc.framework; 
     1153                        path = Frameworks/libsilc.framework; 
     1154                        refType = 4; 
     1155                        sourceTree = "<group>"; 
     1156                }; 
     1157                1C5A249206FA6AAA00A51F10 = { 
     1158                        isa = PBXFileReference; 
     1159                        lastKnownFileType = wrapper.framework; 
     1160                        name = libsilcclient.framework; 
     1161                        path = Frameworks/libsilcclient.framework; 
     1162                        refType = 4; 
     1163                        sourceTree = "<group>"; 
     1164                }; 
     1165                1C5A249306FA6AAA00A51F10 = { 
     1166                        fileRef = 1C5A249106FA6AAA00A51F10; 
     1167                        isa = PBXBuildFile; 
     1168                        settings = { 
     1169                        }; 
     1170                }; 
     1171                1C5A249406FA6AAA00A51F10 = { 
     1172                        fileRef = 1C5A249206FA6AAA00A51F10; 
     1173                        isa = PBXBuildFile; 
     1174                        settings = { 
     1175                        }; 
     1176                }; 
     1177                1C5A249506FA6AB600A51F10 = { 
     1178                        fileRef = 1C5A249106FA6AAA00A51F10; 
     1179                        isa = PBXBuildFile; 
     1180                        settings = { 
     1181                        }; 
     1182                }; 
     1183                1C5A249606FA6AB600A51F10 = { 
     1184                        fileRef = 1C5A249206FA6AAA00A51F10; 
     1185                        isa = PBXBuildFile; 
     1186                        settings = { 
     1187                        }; 
     1188                }; 
    11311189                1C6075E005138ED600A8FE6E = { 
    11321190                        isa = PBXFileReference; 
     
    19101968                        ); 
    19111969                        buildSettings = { 
    1912                                 FRAMEWORK_SEARCH_PATHS = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\" Frameworks build"; 
     1970                                FRAMEWORK_SEARCH_PATHS = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\" Frameworks build /Users/Timothy/Projects/Colloquy/Frameworks"; 
    19131971                                GCC_OPTIMIZATION_LEVEL = 0; 
    19141972                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     
    26922750                                1C3B290806529E720066197C, 
    26932751                                1C8D2E72065D0BB600AC28C5, 
     2752                                1C5A249306FA6AAA00A51F10, 
     2753                                1C5A249406FA6AAA00A51F10, 
    26942754                        ); 
    26952755                        isa = PBXFrameworksBuildPhase; 
     
    27422802                                1CB2CD85052DDC560094AAA4, 
    27432803                                1CB2CD86052DDC560094AAA4, 
     2804                                1C5A249506FA6AB600A51F10, 
     2805                                1C5A249606FA6AB600A51F10, 
    27442806                        ); 
    27452807                        isa = PBXCopyFilesBuildPhase; 
     
    44504512                                F52D043001873FC401EE70DE, 
    44514513                                F52D043101873FC401EE70DE, 
     4514                                1C5A232106FA4FC000A51F10, 
     4515                                1C5A232006FA4FC000A51F10, 
    44524516                                1C8CF8E2066530D60080A2F5, 
    44534517                                1C8CF8E1066530D60080A2F5, 
  • trunk/Languages/English.lproj/Credits.rtf

    r1684 r1869  
    1515\f2\fs20 \cf0 Karl Adam (\cf2 karl@colloquy.info\cf0 )\ 
    1616Kevin Ballard (\cf2 kevin@colloquy.info\cf0 )\ 
     17Patrik Weiskircher (\cf2 pat@colloquy.info\cf0 )\ 
    1718\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
    1819 
     
    2021\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
    2122 
    22 \fs24 \cf0 Chat Engine 
     23\fs24 \cf0 IRC Chat Engine 
    2324\f1\b0 \ 
    2425\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
     
    3031\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
    3132\cf2 \ulnone http://irssi.org\ 
     33\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
     34 
     35\f0\b \cf0 \ 
     36\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
     37 
     38\fs24 \cf0 SILC Chat Engine 
     39\f1\b0 \ 
     40\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
     41 
     42\f3\i\fs20 \cf0 SILC Toolkit 
     43\f2\i0 \ 
     44\'a9 1997-2004 SILC Project under the GPL.\ 
     45See the GNU Public License v. 2 for more details.\cf2 \ul \ulc2 \ 
     46\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
     47\cf2 \ulnone http://silcnet.org\ 
    3248\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 
    3349 
  • trunk/MVChatConnection.h

    r1866 r1869  
    114114        unsigned int _nextAltNickIndex; 
    115115} 
     116- (id) initWithType:(MVChatConnectionType) type; 
    116117- (id) initWithURL:(NSURL *) url; 
    117118- (id) initWithServer:(NSString *) server type:(MVChatConnectionType) type port:(unsigned short) port user:(NSString *) nickname; 
  • trunk/MVChatConnection.m

    r1868 r1869  
    11#import "MVChatConnection.h" 
    22#import "MVIRCChatConnection.h" 
     3#import "MVSILCChatConnection.h" 
    34#import "MVFileTransfer.h" 
    45#import "MVChatPluginManager.h" 
     
    104105} 
    105106 
     107- (id) initWithType:(MVChatConnectionType) type { 
     108        NSZone *zone = [self zone]; 
     109        [self release]; 
     110 
     111        if( type == MVChatConnectionIRCType ) { 
     112                self = [[MVIRCChatConnection allocWithZone:zone] init]; 
     113        } else if ( type == MVChatConnectionSILCType ) { 
     114                self = [[MVSILCChatConnection allocWithZone:zone] init]; 
     115        } else self = nil; 
     116 
     117        return self; 
     118} 
     119 
    106120- (id) initWithURL:(NSURL *) url { 
    107121        int type = 0; 
    108122        if( [[url scheme] isEqualToString:@"irc"] ) type = MVChatConnectionIRCType; 
    109123        else if( [[url scheme] isEqualToString:@"silc"] ) type = MVChatConnectionSILCType; 
    110  
    111         if( ! type ) { 
    112                 [self release]; 
    113                 return nil; 
    114         } 
    115124 
    116125        if( ( self = [self initWithServer:[url host] type:type port:[[url port] unsignedShortValue] user:[url user]] ) ) { 
     
    123132                } 
    124133        } 
     134 
    125135        return self; 
    126136} 
    127137 
    128138- (id) initWithServer:(NSString *) server type:(MVChatConnectionType) type port:(unsigned short) port user:(NSString *) nickname { 
    129         NSZone *zone = [self zone]; 
    130         [self release]; 
    131  
    132         if( type == MVChatConnectionIRCType ) { 
    133                 self = [[MVIRCChatConnection allocWithZone:zone] init]; 
    134         } else self = nil; 
    135  
    136         if( self ) { 
     139        if( ( self = [self initWithType:type] ) ) { 
    137140                if( [nickname length] ) [self setNickname:nickname]; 
    138141                if( [server length] ) [self setServer:server]; 
     
    695698        _status = MVChatConnectionDisconnectedStatus; 
    696699        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatConnectionDidNotConnectNotification object:self]; 
    697         [self performSelector:@selector( _detachConnection ) withObject:nil afterDelay:0.]; // wait until the next run loop, so we are done disconnecting 
    698700        [self _scheduleReconnectAttemptEvery:30.]; 
    699701} 
     
    718720        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatConnectionDidDisconnectNotification object:self]; 
    719721} 
     722 
     723#pragma mark - 
    720724 
    721725- (void) _scheduleReconnectAttemptEvery:(NSTimeInterval) seconds { 
     
    729733        [_reconnectTimer release]; 
    730734        _reconnectTimer = nil; 
     735} 
     736 
     737#pragma mark - 
     738 
     739- (void) _addRoomToCache:(NSMutableDictionary *) info { 
     740        [_roomsCache setObject:info forKey:[info objectForKey:@"room"]]; 
     741        [info removeObjectForKey:@"room"]; 
     742         
     743        NSNotification *notification = [NSNotification notificationWithName:MVChatConnectionGotRoomInfoNotification object:self]; 
     744        [[NSNotificationQueue defaultQueue] enqueueNotification:notification postingStyle:NSPostASAP]; 
    731745} 
    732746@end 
  • trunk/MVConnectionsController.m

    r1862 r1869  
    376376        [openConnection orderOut:nil]; 
    377377 
    378         connection = [[[MVChatConnection alloc] init] autorelease]; 
     378        connection = [[[MVChatConnection alloc] initWithType:MVChatConnectionIRCType] autorelease]; 
    379379        [connection setEncoding:[[NSUserDefaults standardUserDefaults] integerForKey:@"JVChatEncoding"]]; 
    380380        [connection setProxyType:[[newProxy selectedItem] tag]]; 
     
    12411241                        [data setObject:[(MVChatConnection *)[info objectForKey:@"connection"] realName] forKey:@"realName"]; 
    12421242                        [data setObject:[(MVChatConnection *)[info objectForKey:@"connection"] username] forKey:@"username"]; 
     1243                        [data setObject:[(MVChatConnection *)[info objectForKey:@"connection"] urlScheme] forKey:@"type"]; 
    12431244 
    12441245                        NSMutableArray *permIgnores = [NSMutableArray array]; 
     
    12691270        while( ( info = [enumerator nextObject] ) ) { 
    12701271                MVChatConnection *connection = nil; 
     1272                MVChatConnectionType type = ( ! [(NSString *)[info objectForKey:@"type"] length] ? MVChatConnectionIRCType : ( [[info objectForKey:@"type"] isEqualToString:@"irc"] ? MVChatConnectionIRCType : ( [[info objectForKey:@"type"] isEqualToString:@"silc"] ? MVChatConnectionSILCType : MVChatConnectionIRCType ) ) ); 
    12711273 
    12721274                if( [info objectForKey:@"url"] ) { 
    12731275                        connection = [[[MVChatConnection alloc] initWithURL:[NSURL URLWithString:[info objectForKey:@"url"]]] autorelease]; 
    12741276                } else { 
    1275                         connection = [[[MVChatConnection alloc] initWithServer:[info objectForKey:@"server"] type:MVChatConnectionIRCType port:[[info objectForKey:@"port"] unsignedShortValue] user:[info objectForKey:@"nickname"]] autorelease]; 
     1277                        connection = [[[MVChatConnection alloc] initWithServer:[info objectForKey:@"server"] type:type port:[[info objectForKey:@"port"] unsignedShortValue] user:[info objectForKey:@"nickname"]] autorelease]; 
    12761278                } 
    12771279 
  • trunk/MVIRCChatConnection.m

    r1868 r1869  
    5757- (SERVER_CONNECT_REC *) _irssiConnectSettings; 
    5858- (void) _setIrssiConnectSettings:(SERVER_CONNECT_REC *) settings; 
    59 - (void) _addRoomToCache:(NSMutableDictionary *) info; 
    6059- (void) _nicknameIdentified:(BOOL) identified; 
    6160- (void) _forceDisconnect; 
     
    830829        if( ! tooLate ) { 
    831830                MVIRCChatConnectionThreadLock = [[NSRecursiveLock alloc] init]; 
    832                 [NSThread detachNewThreadSelector:@selector( _connectionRunLoop ) toTarget:self withObject:nil]; 
     831                [NSThread detachNewThreadSelector:@selector( _irssiRunLoop ) toTarget:self withObject:nil]; 
    833832                tooLate = YES; 
    834833        } 
     
    15591558} 
    15601559 
    1561 + (void) _connectionRunLoop { 
     1560+ (void) _irssiRunLoop { 
    15621561        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    15631562 
     
    15931592        extern unsigned int connectionCount; 
    15941593        while( ! MVChatApplicationQuitting || connectionCount ) { 
    1595                 usleep( 10 ); // give time for other theads to lock 
     1594                usleep( 50 ); // give time for other theads to lock 
    15961595                if( [MVIRCChatConnectionThreadLock tryLock] ) { // prevents some deadlocks 
    15971596                        g_main_iteration( TRUE ); 
     
    16761675 
    16771676        [MVIRCChatConnectionThreadLock unlock]; 
    1678 } 
    1679  
    1680 #pragma mark - 
    1681  
    1682 - (void) _addRoomToCache:(NSMutableDictionary *) info { 
    1683         [_roomsCache setObject:info forKey:[info objectForKey:@"room"]]; 
    1684         [info removeObjectForKey:@"room"]; 
    1685  
    1686         NSNotification *notification = [NSNotification notificationWithName:MVChatConnectionGotRoomInfoNotification object:self]; 
    1687         [[NSNotificationQueue defaultQueue] enqueueNotification:notification postingStyle:NSPostASAP]; 
    16881677} 
    16891678