Ignore:
Timestamp:
11/19/08 15:00:00 (4 years ago)
Author:
CrawfordCurrie
Message:

Item175: port a subset of the standard extensions over to the new namespace to make a working system with mixed TWiki and Foswiki plugins

Location:
trunk/MailerContrib/lib/Foswiki
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib/Subscriber.pm

    r781 r811  
    22# 
    33# Copyright (C) 2004 Wind River Systems Inc. 
    4 # Copyright (C) 1999-2006 TWiki Contributors. 
    5 # All Rights Reserved. TWiki Contributors 
     4# Copyright (C) 1999-2006 Foswiki Contributors. 
     5# All Rights Reserved. Foswiki Contributors 
    66# are listed in the AUTHORS file in the root of this distribution. 
    77# NOTE: Please extend that file, not this notice. 
     
    2323=pod 
    2424 
    25 ---+ package TWiki::Contrib::MailerContrib::Subscriber 
     25---+ package Foswiki::Contrib::MailerContrib::Subscriber 
    2626Object that represents a subscriber to notification. A subscriber is 
    2727a name (which may be a wikiName or an email address) and a list of 
     
    3333=cut 
    3434 
    35 package TWiki::Contrib::MailerContrib::Subscriber; 
    36  
    37 use TWiki; 
    38 use TWiki::Plugins; 
     35package Foswiki::Contrib::MailerContrib::Subscriber; 
     36 
     37use Foswiki; 
     38use Foswiki::Plugins; 
    3939use Assert; 
    4040 
    41 require TWiki::Contrib::MailerContrib::WebNotify; 
     41require Foswiki::Contrib::MailerContrib::WebNotify; 
    4242 
    4343=pod 
     
    8787    return $emails unless $name; 
    8888 
    89     if ( $name =~ /^$TWiki::cfg{MailerContrib}{EmailFilterIn}$/ ) { 
     89    if ( $name =~ /^$Foswiki::cfg{MailerContrib}{EmailFilterIn}$/ ) { 
    9090        push( @{$emails}, $name ); 
    9191    } else { 
    92         my $users = $TWiki::Plugins::SESSION->{users}; 
     92        my $users = $Foswiki::Plugins::SESSION->{users}; 
    9393        if ($users->can('findUserByWikiName')) { 
    9494            # User is represented by a wikiname. Map to a canonical 
     
    210210---++ isSubscribedTo($topic, $db) -> $subscription 
    211211   * =$topic= - Topic object we are checking 
    212    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parents 
     212   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parents 
    213213Check if we have a subscription to the given topic. Return the subscription 
    214214that matches if we do, undef otherwise. 
     
    232232---++ isUnsubscribedFrom($topic) -> $subscription 
    233233   * =$topic= - Topic object we are checking 
    234    * =$db= - TWiki::Contrib::MailerContrib::UpData database of parents 
     234   * =$db= - Foswiki::Contrib::MailerContrib::UpData database of parents 
    235235Check if we have an unsubscription from the given topic. Return the subscription that matches if we do, undef otherwise. 
    236236 
     
    267267 
    268268    my $name = $this->{name}; 
    269     if ($name =~ /^$TWiki::regex{wikiWordRegex}$/) { 
     269    if ($name =~ /^$Foswiki::regex{wikiWordRegex}$/) { 
    270270        $name = '%USERSWEB%.'.$name; 
    271     } elsif ($name !~ /^$TWiki::cfg{MailerContrib}{EmailFilterIn})$/) { 
     271    } elsif ($name !~ /^$Foswiki::cfg{MailerContrib}{EmailFilterIn})$/) { 
    272272        $name = $name =~ /'/ ? '"'.$name.'"' : "'$name'"; 
    273273    } 
Note: See TracChangeset for help on using the changeset viewer.