Changeset 3760

Show
Ignore:
Timestamp:
10/15/07 01:56:16 (7 months ago)
Author:
timothy
Message:

Allow plugin commands to be used again for auto commands in connections during application launch. This mainly affected using the /msg command. #1039

Files:

Legend:

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

    r3344 r3760  
    55        @private 
    66        NSMutableArray *_plugins; 
     7        BOOL _reloadingPlugins; 
    78} 
    89+ (MVChatPluginManager *) defaultManager; 
  • trunk/Chat Core/MVChatPluginManager.m

    r3525 r3760  
    1111@implementation MVChatPluginManager 
    1212+ (MVChatPluginManager *) defaultManager { 
    13         return ( sharedInstance ? sharedInstance : ( sharedInstance = [[self allocWithZone:nil] init] ) ); 
     13        if( ! sharedInstance ) { 
     14                sharedInstance = [self allocWithZone:nil]; 
     15                sharedInstance = [sharedInstance init]; 
     16        } 
     17 
     18        return sharedInstance; 
    1419} 
    1520 
     
    3439 
    3540- (id) init { 
    36         if( ( self = [super init] ) ) { 
    37                 _plugins = [[NSMutableArray allocWithZone:nil] init]; 
    38                 [self performSelector:@selector(reloadPlugins) withObject:nil afterDelay:0.]; 
    39                 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( applicationWillTerminate: ) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]]; 
    40         } 
     41        if( ! ( self = [super init] ) ) 
     42                return nil; 
     43 
     44        _plugins = [[NSMutableArray allocWithZone:nil] init]; 
     45        [self reloadPlugins]; 
     46 
     47        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( applicationWillTerminate: ) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]]; 
     48 
    4149        return self; 
    4250} 
     
    6068 
    6169- (void) reloadPlugins { 
     70        if( _reloadingPlugins ) return; 
     71        _reloadingPlugins = YES; 
     72 
    6273        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatPluginManagerWillReloadPluginsNotification object:self]; 
    6374 
     
    91102 
    92103        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatPluginManagerDidReloadPluginsNotification object:self]; 
     104 
     105        _reloadingPlugins = NO; 
    93106} 
    94107 
  • trunk/Colloquy.xcodeproj/project.pbxproj

    r3755 r3760  
    381381                        containerPortal = 0A60C15F0630D96D00DC6280 /* Chat Core.xcodeproj */; 
    382382                        proxyType = 1; 
    383                         remoteGlobalIDString = 1C51B46E052DE0CB00BB459B /* Chat Core (Framework) */
     383                        remoteGlobalIDString = 1C51B46E052DE0CB00BB459B
    384384                        remoteInfo = "Chat Core (Framework)"; 
    385385                };