Changeset 4751

Show
Ignore:
Timestamp:
05/11/07 20:36:03 (2 years ago)
Author:
morris
Message:

Add Growl support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/English.lproj/ReleaseNotes.rtf

    r4463 r4751  
    3030\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 
    3131 
    32 \f1\b0 \cf0 - Fix a problem with chat window being hidden after connect\ 
     32\f1\b0 \cf0 - Add Growl support\ 
     33- Fix a problem with chat window being hidden after connect\ 
    3334- Fix a problem with transfer queueing when adding multiple transfers at the same time\ 
    3435- Don't scroll chat to bottom after changing preferences\ 
  • WiredClient/trunk/NSNotificationCenter-WCAdditions.h

    r4439 r4751  
    2626 * POSSIBILITY OF SUCH DAMAGE. 
    2727 */ 
    28  
     28/* 
    2929@interface NSNotificationCenter(WCNotificationCenterAdditions) 
    3030 
    3131- (void)postNotificationName:(NSString *)name eventTag:(int)tag; 
     32- (void)postNotificationName:(NSString *)name eventTag:(int)tag eventInfo:(id)eventInfo; 
    3233- (void)mainThreadPostNotificationName:(NSString *)name eventTag:(int)tag; 
     34- (void)mainThreadPostNotificationName:(NSString *)name eventTag:(int)tag eventInfo:(id)eventInfo; 
    3335 
    3436@end 
     37 
     38 
     39@interface NSNotification(WCNotificationAdditions) 
     40 
     41- (id)eventInfo; 
     42 
     43@end 
     44*/ 
  • WiredClient/trunk/NSNotificationCenter-WCAdditions.m

    r4439 r4751  
    2626 * POSSIBILITY OF SUCH DAMAGE. 
    2727 */ 
     28/* 
     29#import "NSNotificationCenter-WCAdditions.h" 
    2830 
    29 #import "NSNotificationCenter-WCAdditions.h" 
     31#define WCNSNotificationEventInfoKey    @"WCNSNotificationEventInfoKey" 
     32 
    3033 
    3134@implementation NSNotificationCenter(WCNotificationCenterAdditions) 
    3235 
    3336- (void)postNotificationName:(NSString *)name eventTag:(int)tag { 
    34         [self postNotificationName:name object:[WCSettings eventForTag:tag]]; 
     37//      [self postNotificationName:name eventTag:tag eventInfo:NULL]; 
     38
     39 
     40 
     41 
     42- (void)postNotificationName:(NSString *)name eventTag:(int)tag eventInfo:(id)info { 
     43//      [self postNotificationName:name 
     44//                                              object:[WCSettings eventForTag:tag] 
     45//                                        userInfo:[NSDictionary dictionaryWithObject:info forKey:WCNSNotificationEventInfoKey]]; 
    3546} 
    3647 
     
    3849 
    3950- (void)mainThreadPostNotificationName:(NSString *)name eventTag:(int)tag { 
    40         [self mainThreadPostNotificationName:name object:[WCSettings eventForTag:tag]]; 
     51//      [self mainThreadPostNotificationName:name eventTag:tag eventInfo:NULL]; 
     52
     53 
     54 
     55 
     56- (void)mainThreadPostNotificationName:(NSString *)name eventTag:(int)tag eventInfo:(id)info { 
     57        [self mainThreadPostNotificationName:name 
     58                                                                  object:[WCSettings eventForTag:tag] 
     59                                                                userInfo:[NSDictionary dictionaryWithObject:info forKey:WCNSNotificationEventInfoKey]]; 
    4160} 
    4261 
    4362@end 
     63 
     64 
     65 
     66@implementation NSNotification(WCNotificationAdditions) 
     67 
     68- (id)eventInfo { 
     69        return [[self userInfo] objectForKey:WCNSNotificationEventInfoKey]; 
     70} 
     71 
     72@end 
     73*/ 
  • WiredClient/trunk/WCApplicationController.h

    r4439 r4751  
    2727 */ 
    2828 
    29 @interface WCApplicationController : WIObject
     29@interface WCApplicationController : WIObject <GrowlApplicationBridgeDelegate>
    3030        IBOutlet NSMenu                                         *_bookmarksMenu; 
    3131        IBOutlet NSMenu                                         *_insertSmileyMenu; 
  • WiredClient/trunk/WCApplicationController.m

    r4481 r4751  
    2727 */ 
    2828 
     29#import "NSNotificationCenter-WCAdditions.h" 
    2930#import "WCAboutWindow.h" 
    3031#import "WCApplicationController.h" 
     
    3940#import "WCStats.h" 
    4041#import "WCTrackers.h" 
     42#import "WCUser.h" 
     43 
     44#define WCGrowlServerConnected                  @"Connected to server" 
     45#define WCGrowlServerDisconnected               @"Disconnected from server" 
     46#define WCGrowlError                                    @"Error" 
     47#define WCGrowlUserJoined                               @"User joined" 
     48#define WCGrowlUserChangedNick                  @"User changed nick" 
     49#define WCGrowlUserChangedStatus                @"User changed status" 
     50#define WCGrowlUserJoined                               @"User joined" 
     51#define WCGrowlUserLeft                                 @"User left" 
     52#define WCGrowlChatReceived                             @"Chat received" 
     53#define WCGrowlHighlightedChatReceived  @"Highlighted chat received" 
     54#define WCGrowlMessageReceived                  @"Message received" 
     55#define WCGrowlNewsPosted                               @"News posted" 
     56#define WCGrowlBroadcastReceived                @"Broadcast received" 
     57#define WCGrowlTransferStarted                  @"Transfer started" 
     58#define WCGrowlTransferFinished                 @"Transfer finished" 
     59 
    4160 
    4261static NSInteger _WCCompareSmileyLength(id, id, void *); 
     
    96115                        NSLog(@"*** -[%@ %@]: could not find image \"%@\"", [self class], NSStringFromSelector(_cmd), file); 
    97116        } 
    98          
    99117         
    100118        array = [NSMutableArray arrayWithObjects: 
     
    353371         
    354372        [WIDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4]; 
     373         
     374        [GrowlApplicationBridge setGrowlDelegate:self]; 
    355375                 
    356376        (void) [WCDock dock]; 
     
    454474- (void)serverConnectionTriggeredEvent:(NSNotification *)notification { 
    455475        NSDictionary            *event; 
     476        WCServerConnection      *connection; 
     477        NSNumber                        *clickContext; 
     478        id                                      info1, info2; 
    456479         
    457480        event = [notification object]; 
     481        connection = [[notification userInfo] objectForKey:WCServerConnectionEventConnectionKey]; 
     482        info1 = [[notification userInfo] objectForKey:WCServerConnectionEventInfo1Key]; 
     483        info2 = [[notification userInfo] objectForKey:WCServerConnectionEventInfo2Key]; 
    458484         
    459485        if([event boolForKey:WCEventsPlaySound]) 
     
    462488        if([event boolForKey:WCEventsBounceInDock]) 
    463489                [NSApp requestUserAttention:NSInformationalRequest]; 
     490         
     491        clickContext = [NSNumber numberWithUnsignedInteger:[[WCDock dock] indexOfConnection:connection]]; 
     492         
     493        switch([event intForKey:WCEventsEvent]) { 
     494                case WCEventsServerConnected: 
     495                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Connected", @"Growl event connected title") 
     496                                                                                description:[NSSWF:NSLS(@"Connected to %@", @"Growl event connected description (server)"), 
     497                                                                                        [connection name]] 
     498                                                                   notificationName:WCGrowlServerConnected 
     499                                                                                   iconData:NULL 
     500                                                                                   priority:0.0 
     501                                                                                   isSticky:NO 
     502                                                                           clickContext:NULL]; 
     503                        break; 
     504 
     505                case WCEventsServerDisconnected: 
     506                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Disconnected", @"Growl event disconnected title") 
     507                                                                                description:[NSSWF:NSLS(@"Disconnected from %@", @"Growl event disconnected description (server)"), 
     508                                                                                        [connection name]] 
     509                                                                   notificationName:WCGrowlServerDisconnected 
     510                                                                                   iconData:NULL 
     511                                                                                   priority:0.0 
     512                                                                                   isSticky:NO 
     513                                                                           clickContext:clickContext]; 
     514                        break; 
     515                 
     516                case WCEventsError: 
     517                        [GrowlApplicationBridge notifyWithTitle:[info1 localizedDescription] 
     518                                                                                description:[info1 localizedFailureReason] 
     519                                                                   notificationName:WCGrowlError 
     520                                                                                   iconData:NULL 
     521                                                                                   priority:0.0 
     522                                                                                   isSticky:NO 
     523                                                                           clickContext:clickContext]; 
     524                        break; 
     525                 
     526                case WCEventsUserJoined: 
     527                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"User joined", @"Growl event user joined title") 
     528                                                                                description:[info1 nick] 
     529                                                                   notificationName:WCGrowlUserJoined 
     530                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     531                                                                                   priority:0.0 
     532                                                                                   isSticky:NO 
     533                                                                           clickContext:clickContext]; 
     534                        break; 
     535                 
     536                case WCEventsUserChangedNick: 
     537                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"User changed nick", @"Growl event user changed nick title") 
     538                                                                                description:[NSSWF:NSLS(@"%@ is now known as %@", @"Growl event user changed nick description (oldnick, newnick)"), 
     539                                                                                        [info1 nick], info2] 
     540                                                                   notificationName:WCGrowlUserChangedNick 
     541                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     542                                                                                   priority:0.0 
     543                                                                                   isSticky:NO 
     544                                                                           clickContext:clickContext]; 
     545                        break; 
     546                 
     547                case WCEventsUserChangedStatus: 
     548                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"User changed status", @"Growl event user changed status title") 
     549                                                                                description:[NSSWF:NSLS(@"%@ changed status to %@", @"Growl event user changed status description (nick, status)"), 
     550                                                                                        [info1 nick], info2] 
     551                                                                   notificationName:WCGrowlUserChangedStatus 
     552                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     553                                                                                   priority:0.0 
     554                                                                                   isSticky:NO 
     555                                                                           clickContext:clickContext]; 
     556                        break; 
     557                 
     558                case WCEventsUserLeft: 
     559                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"User left", @"Growl event user left title") 
     560                                                                                description:[info1 nick] 
     561                                                                   notificationName:WCGrowlUserLeft 
     562                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     563                                                                                   priority:0.0 
     564                                                                                   isSticky:NO 
     565                                                                           clickContext:clickContext]; 
     566                        break; 
     567                 
     568                case WCEventsChatReceived: 
     569                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Chat received", @"Growl event chat received title") 
     570                                                                                description:[NSSWF:@"%@: %@", [info1 nick], info2] 
     571                                                                   notificationName:WCGrowlChatReceived 
     572                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     573                                                                                   priority:0.0 
     574                                                                                   isSticky:NO 
     575                                                                           clickContext:clickContext]; 
     576                        break; 
     577                 
     578                case WCEventsHighlightedChatReceived: 
     579                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Chat received", @"Growl event chat received title") 
     580                                                                                description:[NSSWF:@"%@: %@", [info1 nick], info2] 
     581                                                                   notificationName:WCGrowlHighlightedChatReceived 
     582                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     583                                                                                   priority:0.0 
     584                                                                                   isSticky:NO 
     585                                                                           clickContext:clickContext]; 
     586                        break; 
     587                 
     588                case WCEventsMessageReceived: 
     589                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Message received", @"Growl event message received title") 
     590                                                                                description:[NSSWF:@"%@: %@", [[(WCMessage *) info1 user] nick], [info1 message]] 
     591                                                                   notificationName:WCGrowlMessageReceived 
     592                                                                                   iconData:[[[(WCMessage *) info1 user] icon] TIFFRepresentation] 
     593                                                                                   priority:0.0 
     594                                                                                   isSticky:NO 
     595                                                                           clickContext:clickContext]; 
     596                        break; 
     597                 
     598                case WCEventsNewsPosted: 
     599                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"News posted", @"Growl event news posted title") 
     600                                                                                description:[NSSWF:@"%@: %@", info1, info2] 
     601                                                                   notificationName:WCGrowlNewsPosted 
     602                                                                                   iconData:NULL 
     603                                                                                   priority:0.0 
     604                                                                                   isSticky:NO 
     605                                                                           clickContext:clickContext]; 
     606                        break; 
     607                 
     608                case WCEventsBroadcastReceived: 
     609                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Broadcast received", @"Growl event broadcast received title") 
     610                                                                                description:[NSSWF:@"%@: %@", [[(WCMessage *) info1 user] nick], [info1 message]] 
     611                                                                   notificationName:WCGrowlBroadcastReceived 
     612                                                                                   iconData:[[[(WCMessage *) info1 user] icon] TIFFRepresentation] 
     613                                                                                   priority:0.0 
     614                                                                                   isSticky:NO 
     615                                                                           clickContext:clickContext]; 
     616                        break; 
     617                 
     618                case WCEventsTransferStarted: 
     619                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Transfer started", @"Growl event transfer started title") 
     620                                                                                description:[info1 name] 
     621                                                                   notificationName:WCGrowlTransferStarted 
     622                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     623                                                                                   priority:0.0 
     624                                                                                   isSticky:NO 
     625                                                                           clickContext:clickContext]; 
     626                        break; 
     627                 
     628                case WCEventsTransferFinished: 
     629                        [GrowlApplicationBridge notifyWithTitle:NSLS(@"Transfer finished", @"Growl event transfer started title") 
     630                                                                                description:[info1 name] 
     631                                                                   notificationName:WCGrowlTransferFinished 
     632                                                                                   iconData:[[info1 icon] TIFFRepresentation] 
     633                                                                                   priority:0.0 
     634                                                                                   isSticky:NO 
     635                                                                           clickContext:clickContext]; 
     636                        break; 
     637        } 
     638} 
     639 
     640 
     641 
     642#pragma mark - 
     643 
     644- (NSDictionary *)registrationDictionaryForGrowl { 
     645        return [NSDictionary dictionaryWithObjectsAndKeys: 
     646                [NSArray arrayWithObjects: 
     647                        WCGrowlServerConnected, 
     648                        WCGrowlServerDisconnected, 
     649                        WCGrowlError, 
     650                        WCGrowlUserJoined, 
     651                        WCGrowlUserChangedNick, 
     652                        WCGrowlUserChangedStatus, 
     653                        WCGrowlUserLeft, 
     654                        WCGrowlChatReceived, 
     655                        WCGrowlHighlightedChatReceived, 
     656                        WCGrowlMessageReceived, 
     657                        WCGrowlNewsPosted, 
     658                        WCGrowlBroadcastReceived, 
     659                        WCGrowlTransferStarted, 
     660                        WCGrowlTransferFinished, 
     661                        NULL], 
     662                GROWL_NOTIFICATIONS_ALL, 
     663                [NSArray arrayWithObjects: 
     664                        WCGrowlServerDisconnected, 
     665                        WCGrowlHighlightedChatReceived, 
     666                        WCGrowlMessageReceived, 
     667                        WCGrowlNewsPosted, 
     668                        WCGrowlBroadcastReceived, 
     669                        WCGrowlTransferFinished, 
     670                        NULL], 
     671                GROWL_NOTIFICATIONS_DEFAULT, 
     672                NULL]; 
     673} 
     674 
     675 
     676 
     677- (void)growlNotificationWasClicked:(id)clickContext { 
     678        WCServerConnection      *connection; 
     679         
     680        [NSApp activateIgnoringOtherApps:YES]; 
     681         
     682        connection = [[WCDock dock] connectionAtIndex:[clickContext unsignedIntegerValue]]; 
     683 
     684        [[WCDock dock] openConnection:connection]; 
    464685} 
    465686 
  • WiredClient/trunk/WCCache.h

    r4439 r4751  
    3131        NSMutableDictionary                     *_files; 
    3232        NSMutableDictionary                     *_fileIcons; 
    33         NSMutableDictionary                     *_transferIcons; 
    3433        NSLock                                          *_lock; 
    3534} 
     
    4746- (NSImage *)fileIconForExtension:(NSString *)extension; 
    4847 
    49 - (void)setTransferIcon:(NSImage *)icon forExtension:(NSString *)extension; 
    50 - (NSImage *)transferIconForExtension:(NSString *)extension; 
    51  
    5248@end 
  • WiredClient/trunk/WCCache.m

    r4439 r4751  
    5151        _files = [[NSMutableDictionary alloc] initWithCapacity:_capacity]; 
    5252        _fileIcons = [[NSMutableDictionary alloc] initWithCapacity:_capacity]; 
    53         _transferIcons = [[NSMutableDictionary alloc] initWithCapacity:_capacity]; 
    5453 
    5554        return self; 
     
    6362        [_files release]; 
    6463        [_fileIcons release]; 
    65         [_transferIcons release]; 
    6664 
    6765        [super dealloc]; 
     
    137135} 
    138136 
    139  
    140  
    141 #pragma mark - 
    142  
    143 - (void)setTransferIcon:(NSImage *)icon forExtension:(NSString *)extension { 
    144         [_lock lock]; 
    145  
    146         if([_transferIcons count] > _capacity) 
    147                 [_transferIcons removeObjectForKey:[[_transferIcons allKeys] objectAtIndex:0]]; 
    148  
    149         [_transferIcons setObject:icon forKey:extension]; 
    150  
    151         [_lock unlock]; 
    152 } 
    153  
    154  
    155  
    156 - (NSImage *)transferIconForExtension:(NSString *)extension { 
    157         NSImage         *image; 
    158  
    159         [_lock lock]; 
    160         image = [_transferIcons objectForKey:extension]; 
    161         [_lock unlock]; 
    162  
    163         return image; 
    164 } 
    165  
    166137@end 
  • WiredClient/trunk/WCChat.m

    r4481 r4751  
    7979- (NSString *)_stringByDecomposingAttributedString:(NSAttributedString *)attributedString; 
    8080 
     81- (BOOL)_isHighlightedChat:(NSString *)chat; 
     82 
    8183@end 
    8284 
     
    253255- (void)_printUserChange:(WCUser *)user status:(NSString *)status { 
    254256        [self printEvent:[NSSWF: 
    255                 NSLS(@"%@ changed status to %@", @"Client rename message (nick, status)"), 
     257                NSLS(@"%@ changed status to %@", @"Client status changed message (nick, status)"), 
    256258                [user nick], 
    257259                status]]; 
     
    571573} 
    572574 
     575 
     576 
     577#pragma mark - 
     578 
     579- (BOOL)_isHighlightedChat:(NSString *)chat { 
     580        NSEnumerator            *enumerator; 
     581        NSDictionary            *highlight; 
     582         
     583        enumerator = [[WCSettings objectForKey:WCHighlights] objectEnumerator]; 
     584         
     585        while((highlight = [enumerator nextObject])) { 
     586                if([chat rangeOfString:[highlight objectForKey:WCHighlightsPattern] options:NSCaseInsensitiveSearch].location != NSNotFound) 
     587                        return YES; 
     588        } 
     589         
     590        return NO; 
     591} 
     592 
    573593@end 
    574594 
     
    856876        [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 
    857877 
    858         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserJoined]; 
     878        [[self connection] triggerEvent:WCEventsUserJoined info1:user]; 
    859879} 
    860880 
     
    881901                [self _printUserLeave:user]; 
    882902 
     903        [[self connection] triggerEvent:WCEventsUserLeft info1:user]; 
     904 
    883905        [_shownUsers removeObject:user]; 
    884906        [_users removeObjectForKey:[NSNumber numberWithUnsignedInt:[user userID]]]; 
    885907         
    886908        [[self connection] postNotificationName:WCChatUsersDidChange object:[self connection]]; 
    887  
    888         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserLeft]; 
    889909} 
    890910 
     
    912932                        [self _printUserChange:user nick:nick]; 
    913933 
    914                 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserChangedNick]; 
     934                [[self connection] triggerEvent:WCEventsUserChangedNick info1:user info2:nick]; 
    915935        } 
    916936 
     
    919939                        [self _printUserChange:user status:status]; 
    920940                 
    921                 [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsUserChangedStatus]; 
    922         } 
    923          
     941                [[self connection] triggerEvent:WCEventsUserChangedStatus info1:user info2:status]; 
     942        } 
     943         
     944        [user setNick:nick]; 
     945        [user setStatus:status]; 
    924946        [user setIdle:[idle intValue]]; 
    925947        [user setAdmin:[admin intValue]]; 
    926         [user setNick:nick]; 
    927         [user setStatus:status]; 
    928948 
    929949        [_userListTableView setNeedsDisplay:YES]; 
     
    10321052 
    10331053        [self _printChat:chat by:user]; 
    1034  
    1035         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 
     1054         
     1055        if([self _isHighlightedChat:chat]) 
     1056                [[self connection] triggerEvent:WCEventsHighlightedChatReceived info1:user info2:chat]; 
     1057        else 
     1058                [[self connection] triggerEvent:WCEventsChatReceived info1:user info2:chat]; 
    10361059} 
    10371060 
     
    10611084        [self _printActionChat:chat by:user]; 
    10621085 
    1063         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsChatReceived]; 
     1086        if([self _isHighlightedChat:chat]) 
     1087                [[self connection] triggerEvent:WCEventsHighlightedChatReceived info1:user info2:chat]; 
     1088        else 
     1089                [[self connection] triggerEvent:WCEventsChatReceived info1:user info2:chat]; 
    10641090} 
    10651091 
  • WiredClient/trunk/WCDock.h

    r4460 r4751  
    5656- (void)openConnection:(WCServerConnection *)connection; 
    5757- (WCServerConnection *)connectionWithURL:(WIURL *)url; 
    58 - (unsigned int)connectedConnections; 
     58- (WCServerConnection *)connectionAtIndex:(NSUInteger)index; 
     59- (NSUInteger)indexOfConnection:(WCServerConnection *)connection; 
     60- (NSUInteger)connectedConnections; 
    5961 
    6062- (IBAction)open:(id)sender; 
  • WiredClient/trunk/WCDock.m

    r4460 r4751  
    4141 
    4242- (WCServerConnection *)_selectedConnection; 
    43 - (WCServerConnection *)_connectionAtIndex:(unsigned int)index; 
     43- (WCServerConnection *)_connectionAtIndex:(NSUInteger)index; 
    4444 
    4545- (void)_openConnection:(WCServerConnection *)connection; 
     
    101101 
    102102 
    103 - (WCServerConnection *)_connectionAtIndex:(unsigned int)index { 
     103- (WCServerConnection *)_connectionAtIndex:(NSUInteger)index { 
    104104        if(index < [_shownConnections count]) 
    105105                return [_shownConnections objectAtIndex:index]; 
     
    372372 
    373373 
    374 - (unsigned int)connectedConnections { 
     374- (WCServerConnection *)connectionAtIndex:(NSUInteger)index { 
     375        return [_shownConnections objectAtIndex:index]; 
     376
     377 
     378 
     379 
     380- (NSUInteger)indexOfConnection:(WCServerConnection *)connection { 
     381        return [_shownConnections indexOfObject:connection]; 
     382
     383 
     384 
     385 
     386- (NSUInteger)connectedConnections { 
    375387        NSEnumerator            *enumerator; 
    376388        WCServerConnection      *connection; 
    377         unsigned int          count; 
     389        NSUInteger                    count; 
    378390         
    379391        enumerator = [_shownConnections objectEnumerator]; 
     
    456468                i = [_shownConnections indexOfObject:connection] + 1; 
    457469                 
    458                 if((unsigned int) i >= [_shownConnections count]) 
     470                if((NSUInteger) i >= [_shownConnections count]) 
    459471                        i = 0; 
    460472                         
     
    543555        NSAlert                         *alert; 
    544556        WCServerConnection      *connection; 
    545         unsigned int          i, count; 
     557        NSUInteger                    i, count; 
    546558         
    547559        alert = [NSAlert alertWithMessageText:NSLS(@"Restore All Layouts To Default?", @"Restore all layouts to default dialog title") 
     
    569581#pragma mark - 
    570582 
    571 - (int)numberOfRowsInTableView:(NSTableView *)tableView { 
     583- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 
    572584        return [_shownConnections count]; 
    573585} 
     
    575587 
    576588 
    577 - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row { 
     589- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 
    578590        WCServerConnection      *connection; 
    579591        NSImage                         *image; 
  • WiredClient/trunk/WCMessages.m

    r4481 r4751  
    621621        [[self connection] postNotificationName:WCMessagesDidAddMessage object:message]; 
    622622 
    623         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsMessageReceived]; 
     623        [[self connection] triggerEvent:WCEventsMessageReceived info1:message]; 
    624624} 
    625625 
     
    658658        [[self connection] postNotificationName:WCMessagesDidAddMessage object:message]; 
    659659 
    660         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsBroadcastReceived]; 
     660        [[self connection] triggerEvent:WCEventsBroadcastReceived info1:message]; 
    661661} 
    662662 
  • WiredClient/trunk/WCNews.m

    r4481 r4751  
    307307        } 
    308308 
    309         [[self connection] postNotificationName:WCServerConnectionTriggeredEvent eventTag:WCEventsNewsPosted]; 
     309        [[self connection] triggerEvent:WCEventsNewsPosted info1:nick info2:message]; 
    310310} 
    311311 
  • WiredClient/trunk/WCPreferences.m

    r4631 r4751  
    184184                [NSNumber numberWithInt:WCEventsUserLeft], 
    185185                [NSNumber numberWithInt:WCEventsChatReceived], 
     186                [NSNumber numberWithInt:WCEventsHighlightedChatReceived], 
    186187                [NSNumber numberWithInt:WCEventsMessageReceived], 
    187188                [NSNumber numberWithInt:WCEventsNewsPosted], 
     
    237238                                case WCEventsChatReceived: 
    238239                                        [item setTitle:NSLS(@"Chat Received", @"Event")]; 
     240                                        break; 
     241 
     242                                case WCEventsHighlightedChatReceived: 
     243                                        [item setTitle:NSLS(@"Highlighted Chat Received", @"Event")]; 
    239244                                        break;&nbs