Changeset 13777
- Timestamp:
- 01/22/12 15:23:10 (4 weeks ago)
- Location:
- trunk/ImmediateNotifyPlugin
- Files:
-
- 2 added
- 6 edited
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm (modified) (3 diffs)
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin/Config.spec (modified) (3 diffs)
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin/IRC.pm (added)
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin/SMTP.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin/Twitter.pm (added)
-
lib/Foswiki/Plugins/ImmediateNotifyPlugin/XMPP.pm (modified) (2 diffs)
-
templates/smtp.immediatenotify.tmpl (modified) (2 diffs)
-
templates/xmpp.immediatenotify.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ImmediateNotifyPlugin/lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm
r13772 r13777 81 81 next if ( $method eq "Module" ); 82 82 next if ( $method eq "Enabled" ); 83 next if ( $method eq "Bitly" ); 83 84 if ( $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{$method}{Enabled} ) { 84 85 debug("Allowing method $method"); … … 215 216 my ( $method, $parms ) = 216 217 $methodString =~ m/^(.*?)(?:\((.*?)\))?$/; 218 $parms |= ''; 217 219 debug( 218 220 "- ImmediateNotifyPlugin: processName: User $name found method ($method) parms ($parms) " … … 236 238 } 237 239 240 241 =begin TML 242 243 ---+ beforeSaveHandler 244 245 Set a flag if this is a new topic. 246 247 =cut 248 249 sub beforeSaveHandler { 250 my ( $text, $topic, $web, $meta ) = @_; 251 252 unless ( Foswiki::Func::topicExists($web, $topic) ) { 253 Foswiki::Func::getContext()->{'NewTopic'} = 1; 254 } 255 } 256 238 257 =begin TML 239 258 -
trunk/ImmediateNotifyPlugin/lib/Foswiki/Plugins/ImmediateNotifyPlugin/Config.spec
r12051 r13777 1 1 # ---+ Extensions 2 2 # ---++ ImmediateNotifyPlugin 3 # ---+++ EMail Notifications 3 4 # **BOOLEAN** 4 5 # Enable SMTP for mailing messages. Note: This plugin uses Foswiki core email support for sending … … 15 16 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{SMTP}{EmailFilterIn} = ''; 16 17 18 # ---+++ Jabber / XMPP 17 19 # **BOOLEAN** 18 20 # Enable XMPP (XMPP) for notifications. … … 33 35 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{XMPP}{Password} = ''; 34 36 37 # ---+++ Twitter 38 # **BOOLEAN** 39 # Enable Twitter for notifications. 40 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Twitter}{Enabled} = $FALSE; 41 42 # **STRING 30** 43 # Specify the username for the twitter account 44 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Twitter}{Username} = ''; 45 46 # **PASSWORD 30** 47 # Specify the password for the twitter account 48 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Twitter}{Password} = ''; 49 50 # ---+++ Bit.ly URL Shortening 51 # **BOOLEAN** 52 # Enable URL Shortening with Bit.ly. 53 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Bitly}{Enabled} = $FALSE; 54 55 # **STRING** 56 # Optionally, specify a bit.ly username 57 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Bitly}{Username} = ''; 58 59 # **STRING** 60 # Optionally, specify a bit.ly API key 61 $Foswiki::cfg{Plugins}{ImmediateNotifyPlugin}{Bitlly}{APIKey} = ''; -
trunk/ImmediateNotifyPlugin/lib/Foswiki/Plugins/ImmediateNotifyPlugin/SMTP.pm
r12252 r13777 43 43 my ($template) = Foswiki::Func::readTemplate( 'smtp', 'immediatenotify' ); 44 44 45 # &$debug("- SMTP: template read $template");45 # Expand legacy macros 46 46 my ($from) = Foswiki::Func::getPreferencesValue("WIKIWEBMASTER"); 47 48 47 $template =~ s/%EMAILFROM%/$from/go; 49 $template =~ s/%WEB%/$info->{web}/go;50 48 $template =~ s/%TOPICNAME%/$info->{topic}/go; 51 49 $template =~ s/%USER%/$info->{user}/go; -
trunk/ImmediateNotifyPlugin/lib/Foswiki/Plugins/ImmediateNotifyPlugin/XMPP.pm
r13772 r13777 105 105 my ($template) = Foswiki::Func::readTemplate( 'xmpp', 'immediatenotify' ); 106 106 107 # &$debug("- SMTP: template read $template"); 107 &$debug("- XMPP: template read $template"); 108 109 # Expand Legacy variables - not used in latest templates 108 110 my ($from) = Foswiki::Func::getPreferencesValue("WIKIWEBMASTER"); 109 110 111 $template =~ s/%EMAILFROM%/$from/go; 111 $template =~ s/% WEB%/$info->{web}/go;112 $template =~ s/%USER%/$info->{user}/go; 112 113 $template =~ s/%TOPICNAME%/$info->{topic}/go; 113 $template =~ s/%USER%/$info->{user}/go;114 114 $template =~ s/%REV%/$info->{version}/go; 115 115 … … 125 125 &$debug(" processing $user"); 126 126 127 #&$debug(" userref = ".ref($userHash->{$user}));128 127 my %uHash = %{ $userHash->{$user} }; 129 128 -
trunk/ImmediateNotifyPlugin/templates/smtp.immediatenotify.tmpl
r12048 r13777 1 From: %WIKIWEBMASTER%1 %TMPL:DEF{smtpHeaders}%From: %WIKIWEBMASTER% 2 2 To: %EMAILTO% 3 3 Subject: %WIKITOOLNAME%.%WEB%.%TOPICNAME% - Immediate notification of topic change 4 4 MIME-Version: 1.0 5 Content-Type: multipart/mixed; boundary="------------2D594AE113AD25493C2C7246"6 7 This is a multi-part message in MIME format.8 --------------2D594AE113AD25493C2C72469 5 Content-Type: text/plain; charset=%CHARSET% 10 6 Content-Transfer-Encoding: 8bit 11 7 8 %TMPL:END% 9 %TMPL:DEF{smtpMessage}% 12 10 This is an automatically generated email. 13 11 14 % USER% has created or changedthe topic15 %SCRIPTURL{"view"}%/%WEB%/%TOPIC NAME% - Revision %REV%12 %WIKINAME% has %IF{"context NewTopic" then="created" else="changed"}% the topic 13 %SCRIPTURL{"view"}%/%WEB%/%TOPIC% - Revision %REVINFO{format="r1.$rev"}% 16 14 17 15 -- … … 20 18 * The IMMEDIATENOTIFY list in the modified topic 21 19 * The %SCRIPTURL{"view"}%/%WEB%/WebImmediateNotify topic 20 %TMPL:END% 21 %TMPL:P{smtpHeaders}%%TMPL:P{smtpMessage}% -
trunk/ImmediateNotifyPlugin/templates/xmpp.immediatenotify.tmpl
r12051 r13777 1 %USER% has created or changed the topic %SCRIPTURL{"view"}%/%WEB%/%TOPICNAME% - Revision %REV% 1 %TMPL:DEF{xmppBody}%%WIKINAME% has %IF{"context NewTopic" then="created" else="changed"}% the topic %SCRIPTURL{"view"}%/%WEB%/%TOPIC% Rev:%REVINFO{format="r1.$rev"}% %INCLUDE{"%WEB%.%TOPIC%" section="NOTIFYTEXT" warn="off"}%%TMPL:END% 2 %TMPL:P{xmppBody}%
Note: See TracChangeset
for help on using the changeset viewer.
