Changeset 3496

Show
Ignore:
Timestamp:
12/28/06 12:13:28 (2 years ago)
Author:
timothy
Message:

Added beep support to Chat Core and Colloquy for protocols that support it. Thanks jmmv!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Chat Core.exp

    r3377 r3496  
    1616_MVChatConnectionNeedCertificatePasswordNotification 
    1717_MVChatConnectionNeedPublicKeyVerificationNotification 
     18_MVChatConnectionGotBeepNotification 
    1819_MVChatConnectionGotRawMessageNotification 
    1920_MVChatConnectionGotPrivateMessageNotification 
  • trunk/Chat Core/MVChatConnection.h

    r3456 r3496  
    6565extern NSString *MVChatConnectionNeedPublicKeyVerificationNotification; 
    6666 
     67extern NSString *MVChatConnectionGotBeepNotification; 
    6768extern NSString *MVChatConnectionGotRawMessageNotification; 
    6869extern NSString *MVChatConnectionGotPrivateMessageNotification; 
  • trunk/Chat Core/MVChatConnection.m

    r3484 r3496  
    2626NSString *MVChatConnectionNeedPublicKeyVerificationNotification = @"MVChatConnectionNeedPublicKeyVerificationNotification"; 
    2727 
     28NSString *MVChatConnectionGotBeepNotification = @"MVChatConnectionGotBeepNotification"; 
    2829NSString *MVChatConnectionGotRawMessageNotification = @"MVChatConnectionGotRawMessageNotification"; 
    2930NSString *MVChatConnectionGotPrivateMessageNotification = @"MVChatConnectionGotPrivateMessageNotification"; 
  • trunk/Controllers/JVChatController.m

    r3418 r3496  
    9090                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _joinedRoom: ) name:MVChatRoomJoinedNotification object:nil]; 
    9191                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _invitedToRoom: ) name:MVChatRoomInvitedNotification object:nil]; 
     92                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _gotBeep: ) name:MVChatConnectionGotBeepNotification object:nil]; 
    9293                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _gotPrivateMessage: ) name:MVChatConnectionGotPrivateMessageNotification object:nil]; 
    9394                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _gotRoomMessage: ) name:MVChatRoomGotMessageNotification object:nil]; 
     
    492493        [context setObject:[NSString stringWithFormat:NSLocalizedString( @"You were invited to %@ by %@.", "bubble message invited to room" ), room, [user nickname]] forKey:@"description"]; 
    493494        [[JVNotificationController defaultController] performNotification:@"JVChatRoomInvite" withContextInfo:context]; 
     495} 
     496 
     497- (void) _gotBeep:(NSNotification *) notification { 
     498        NSDictionary *userInfo = [notification userInfo]; 
     499        MVChatUser *user = [userInfo objectForKey:@"user"]; 
     500 
     501        NSMutableDictionary *context = [NSMutableDictionary dictionary]; 
     502        [context setObject:NSLocalizedString( @"Beep received", "beep bubble title" ) forKey:@"title"]; 
     503        [context setObject:[NSString stringWithFormat:NSLocalizedString( @"%@ is reclaiming your attention by means of a beep.", "beep bubble text" ), [user nickname]] forKey:@"description"]; 
     504        [context setObject:[NSImage imageNamed:@"activityNewImportant"] forKey:@"image"]; 
     505        [context setObject:[[user nickname] stringByAppendingString:@"JVChatBeeped"] forKey:@"coalesceKey"]; 
     506        [context setObject:self forKey:@"target"]; 
     507        [context setObject:NSStringFromSelector( @selector( activate: ) ) forKey:@"action"]; 
     508        [[JVNotificationController defaultController] performNotification:@"JVChatBeeped" withContextInfo:context]; 
    494509} 
    495510 
  • trunk/Panels/JVChatRoomPanel.m

    r3490 r3496  
    307307                else [context setObject:[NSString stringWithFormat:NSLocalizedString( @"%@ has %d messages waiting. \nLast from %@", "new room messages bubble text" ), [self title], [self newMessagesWaiting], [member displayName]] forKey:@"description"]; 
    308308                [context setObject:[NSImage imageNamed:@"room"] forKey:@"image"]; 
    309                 [context setObject:[[self windowTitle] stringByAppendingString:@" JVChatRoomActivity"] forKey:@"coalesceKey"]; 
     309                [context setObject:[[self windowTitle] stringByAppendingString:@"JVChatRoomActivity"] forKey:@"coalesceKey"]; 
    310310                [context setObject:self forKey:@"target"]; 
    311311                [context setObject:NSStringFromSelector( @selector( activate: ) ) forKey:@"action"]; 
  • trunk/Panels/JVDirectChatPanel.m

    r3480 r3496  
    774774                else [context setObject:[NSString stringWithFormat:NSLocalizedString( @"One of your highlight words was mentioned by %@.", "private chat mentioned bubble text" ), [self title]] forKey:@"description"]; 
    775775                [context setObject:[NSImage imageNamed:@"activityNewImportant"] forKey:@"image"]; 
    776                 [context setObject:[[self windowTitle] stringByAppendingString:@" JVChatMentioned"] forKey:@"coalesceKey"]; 
     776                [context setObject:[[self windowTitle] stringByAppendingString:@"JVChatMentioned"] forKey:@"coalesceKey"]; 
    777777                [context setObject:self forKey:@"target"]; 
    778778                [context setObject:NSStringFromSelector( @selector( activate: ) ) forKey:@"action"]; 
     
    833833                        [context setObject:[NSString stringWithFormat:NSLocalizedString( @"%@ wrote you a private message.", "first message bubble text" ), [self title]] forKey:@"description"]; 
    834834                        [context setObject:[NSImage imageNamed:@"messageUser"] forKey:@"image"]; 
    835                         [context setObject:[[self windowTitle] stringByAppendingString:@" JVChatPrivateMessage"] forKey:@"coalesceKey"]; 
     835                        [context setObject:[[self windowTitle] stringByAppendingString:@"JVChatPrivateMessage"] forKey:@"coalesceKey"]; 
    836836                        [context setObject:self forKey:@"target"]; 
    837837                        [context setObject:NSStringFromSelector( @selector( activate: ) ) forKey:@"action"]; 
     
    843843                        [context setObject:[NSString stringWithFormat:NSLocalizedString( @"You have %d messages waiting from %@.", "new messages bubble text" ), [self newMessagesWaiting], [self title]] forKey:@"description"]; 
    844844                        [context setObject:[NSImage imageNamed:@"messageUser"] forKey:@"image"]; 
    845                         [context setObject:[[self windowTitle] stringByAppendingString:@" JVChatPrivateMessage"] forKey:@"coalesceKey"]; 
     845                        [context setObject:[[self windowTitle] stringByAppendingString:@"JVChatPrivateMessage"] forKey:@"coalesceKey"]; 
    846846                        [context setObject:self forKey:@"target"]; 
    847847                        [context setObject:NSStringFromSelector( @selector( activate: ) ) forKey:@"action"]; 
  • trunk/Resources/info.colloquy.plist

    r3260 r3496  
    186186                <key>soundPath</key> 
    187187                <string>Switch.aiff</string> 
     188        </dict> 
     189        <key>JVNotificationSettings JVChatBeeped</key> 
     190        <dict> 
     191                <key>bounceIcon</key> 
     192                <true/> 
     193                <key>bounceIconUntilFront</key> 
     194                <true/> 
     195                <key>playSound</key> 
     196                <true/> 
     197                <key>soundPath</key> 
     198                <string>Bell 1.aiff</string> 
     199                <key>showBubble</key> 
     200                <true/> 
     201                <key>showBubbleOnlyIfBackground</key> 
     202                <true/> 
    188203        </dict> 
    189204        <key>JVNotificationSettings JVChatMentioned</key> 
  • trunk/Resources/notifications.plist

    r2694 r3496  
    153153        <dict> 
    154154                <key>identifier</key> 
     155                <string>JVChatBeeped</string> 
     156                <key>title</key> 
     157                <string>Someone Beeped You</string> 
     158        </dict> 
     159        <dict> 
     160                <key>identifier</key> 
    155161                <string>JVChatMentioned</string> 
    156162                <key>title</key>