Ignore:
Timestamp:
01/24/12 21:16:27 (4 months ago)
Author:
GeorgeClark
Message:

Item9551: Some cleanup

And start to convert the twitter and irc code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ImmediateNotifyPlugin/lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm

    r13777 r13817  
    2323my %methodHandlers;    # Loaded handlers 
    2424my %methodAllowed;     # Methods permitted by config. 
    25  
    26 =begin TML 
    27  
    28 ---+ debug ( $message ) 
    29  
    30 Write debug messages if debug is enabled. 
    31  
    32 =cut 
    3325 
    3426=begin TML 
     
    8173        next if ( $method eq "Module" ); 
    8274        next if ( $method eq "Enabled" ); 
    83         next if ( $method eq "Bitly" ); 
     75        next if ( $method eq "Bitly" );     # Bitly is not a notifier plugin 
    8476        if ( $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{$method}{Enabled} ) { 
    8577            debug("Allowing method $method"); 
     
    183175 
    184176    debug("- ImmediateNotifyPlugin: Processing name $name"); 
    185     return if exists $users->{$name};    # Already saw this name - skip it. 
     177    return 
     178      if ( exists $users->{$name} || exists $groups->{name} ) 
     179      ;    # Already saw this name - skip it. 
    186180 
    187181    if ( Foswiki::Func::isGroup($name) ) { 
    188         return if exists $groups->{$name};    # don't reprocess groups 
    189182        $groups->{$name} = $name; 
    190183 
     
    216209                my ( $method, $parms ) = 
    217210                  $methodString =~ m/^(.*?)(?:\((.*?)\))?$/; 
    218                   $parms |= ''; 
     211                $parms |= ''; 
    219212                debug( 
    220213"- ImmediateNotifyPlugin: processName: User $name found method ($method) parms ($parms) " 
    221214                ); 
    222215                $users->{$name}{METHOD} = $method || 'SMTP'; 
    223                 $users->{$name}{PARMS}  = $parms  || ''; 
     216                $users->{$name}{PARMS} = $parms; 
    224217            } 
    225218            else { 
     
    238231} 
    239232 
    240  
    241233=begin TML 
    242234 
     
    250242    my ( $text, $topic, $web, $meta ) = @_; 
    251243 
    252     unless ( Foswiki::Func::topicExists($web, $topic) ) { 
    253       Foswiki::Func::getContext()->{'NewTopic'} = 1; 
     244    unless ( Foswiki::Func::topicExists( $web, $topic ) ) { 
     245        Foswiki::Func::getContext()->{'NewTopic'} = 1; 
    254246    } 
    255247} 
     
    274266# This handler is called by Foswiki::Store::saveTopic just after the save action. 
    275267 
    276     debug("- ImmediateNotifyPlugin::afterSaveHandler( $_[2].$_[1] )"); 
     268    debug("- ImmediateNotifyPlugin::afterSaveHandler( $web.$topic )"); 
    277269 
    278270    if ($error) { 
     
    285277  # in Item9563 or changes made in the save will be missed. 
    286278 
    287     my $testSet = $topicObject->getPreference('IMMEDIATENOTIFY'); 
    288     debug("- ImmediateNotifyPlugin: getPreference returned $testSet \n") 
    289       if $testSet; 
    290  
    291279    my @names; 
    292  
    293 # NOTE: in this case we DO want to use the Meta::getPreference() function.  If the normal 
    294 # preferences API is used, settings are cached and don't reflect changes just saved in this 
    295 # transaction.  The Meta function uses the raw topic data and not the cached settings. 
    296280 
    297281# Check if the topic contains an IMMEDIATENOTIFY setting and extract names if present 
     
    379363Foswiki - The Free and Open Source Wiki, http://foswiki.org/ 
    380364 
    381 Copyright (C) 2008-2011 Foswiki Contributors. Foswiki Contributors 
     365Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors 
    382366are listed in the AUTHORS file in the root of this distribution. 
    383367 
    384 Copyright (C) 2010-2011 George Clark 
    385368Copyright (C) 2003 Walter Mundt, emage@spamcop.net 
    386369Copyright (C) 2003 Akkaya Consulting GmbH, jpabel@akkaya.de 
Note: See TracChangeset for help on using the changeset viewer.