2012-04-27 15:14:24 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* MediaWiki Extension: Echo
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @author Andrew Garrett
|
|
|
|
*/
|
|
|
|
|
|
|
|
# Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
echo <<<EOT
|
|
|
|
To install this extension, put the following line in LocalSettings.php:
|
|
|
|
require_once( "$IP/extensions/Echo/Echo.php" );
|
|
|
|
EOT;
|
|
|
|
exit( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Extension credits that will show up on Special:Version
|
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'Echo',
|
2012-12-14 16:49:06 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:Echo',
|
|
|
|
'author' => array( 'Andrew Garrett', 'Ryan Kaldari', 'Benny Situ', 'Luke Welling' ),
|
2012-04-27 15:14:24 +00:00
|
|
|
'descriptionmsg' => 'echo-desc',
|
|
|
|
);
|
|
|
|
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['Echo'] = $dir . 'Echo.i18n.php';
|
2012-10-23 22:37:22 +00:00
|
|
|
$wgExtensionMessagesFiles['EchoAliases'] = $dir . 'Echo.alias.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoHooks'] = $dir . 'Hooks.php';
|
|
|
|
$wgAutoloadClasses['EchoSubscription'] = $dir . 'model/Subscription.php';
|
|
|
|
$wgAutoloadClasses['EchoEvent'] = $dir . 'model/Event.php';
|
|
|
|
$wgAutoloadClasses['EchoNotification'] = $dir . 'model/Notification.php';
|
|
|
|
$wgAutoloadClasses['MWEchoEmailBatch'] = $dir . 'includes/EmailBatch.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Formatters
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotificationFormatter'] = $dir . 'formatters/NotificationFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoBasicFormatter'] = $dir . 'formatters/BasicFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoEditFormatter'] = $dir . 'formatters/EditFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoCommentFormatter'] = $dir . 'formatters/CommentFormatter.php';
|
2012-12-26 22:05:29 +00:00
|
|
|
$wgAutoloadClasses['MWEchoArticleLinkedFormatter'] = $dir . 'formatters/ArticleLinkedFormatter.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Internal stuff
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotifier'] = $dir . 'Notifier.php';
|
|
|
|
$wgAutoloadClasses['EchoNotificationController'] = $dir . 'controller/NotificationController.php';
|
|
|
|
$wgAutoloadClasses['EchoDiscussionParser'] = $dir . 'includes/DiscussionParser.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-06-06 07:04:28 +00:00
|
|
|
// Job queue
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotificationJob'] = $dir . 'jobs/NotificationJob.php';
|
2012-06-06 07:04:28 +00:00
|
|
|
$wgJobClasses['EchoNotificationJob'] = 'EchoNotificationJob';
|
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// API
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['ApiEchoNotifications'] = $dir . 'api/ApiEchoNotifications.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgAPIMetaModules['notifications'] = 'ApiEchoNotifications';
|
|
|
|
|
|
|
|
// Special page
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['SpecialNotifications'] = $dir . 'special/SpecialNotifications.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgSpecialPages['Notifications'] = 'SpecialNotifications';
|
2013-01-30 09:31:34 +00:00
|
|
|
$wgSpecialPageGroups['Notifications'] = 'users';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Housekeeping hooks
|
|
|
|
$wgHooks['LoadExtensionSchemaUpdates'][] = 'EchoHooks::getSchemaUpdates';
|
|
|
|
$wgHooks['GetPreferences'][] = 'EchoHooks::getPreferences';
|
2012-06-01 10:57:09 +00:00
|
|
|
$wgHooks['PersonalUrls'][] = 'EchoHooks::onPersonalUrls';
|
|
|
|
$wgHooks['BeforePageDisplay'][] = 'EchoHooks::beforePageDisplay';
|
2012-07-31 21:18:16 +00:00
|
|
|
$wgHooks['MakeGlobalVariablesScript'][] = 'EchoHooks::makeGlobalVariablesScript';
|
2012-07-31 00:29:49 +00:00
|
|
|
$wgHooks['UnitTestsList'][] = 'EchoHooks::getUnitTests';
|
2012-06-01 10:57:09 +00:00
|
|
|
|
|
|
|
$echoResourceTemplate = array(
|
2012-12-14 16:34:12 +00:00
|
|
|
'localBasePath' => $dir . 'modules',
|
2012-06-01 10:57:09 +00:00
|
|
|
'remoteExtPath' => 'Echo/modules',
|
|
|
|
'group' => 'ext.echo',
|
|
|
|
);
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
$wgResourceModules += array(
|
2012-06-01 10:57:09 +00:00
|
|
|
'ext.echo.base' => $echoResourceTemplate + array(
|
|
|
|
'styles' => 'base/ext.echo.base.css',
|
2012-07-31 21:18:16 +00:00
|
|
|
'scripts' => 'base/ext.echo.base.js',
|
2012-06-01 10:57:09 +00:00
|
|
|
),
|
|
|
|
'ext.echo.overlay' => $echoResourceTemplate + array(
|
2012-07-31 21:18:16 +00:00
|
|
|
'scripts' => array(
|
|
|
|
'overlay/ext.echo.overlay.js',
|
|
|
|
),
|
2012-06-01 10:57:09 +00:00
|
|
|
'styles' => 'overlay/ext.echo.overlay.css',
|
2012-07-31 21:18:16 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'ext.echo.base',
|
|
|
|
'mediawiki.api',
|
|
|
|
'mediawiki.jqueryMsg',
|
2012-07-30 21:38:25 +00:00
|
|
|
'jquery.badge',
|
2012-07-31 00:29:49 +00:00
|
|
|
'ext.echo.icons',
|
2012-07-31 21:18:16 +00:00
|
|
|
),
|
2012-06-08 05:55:01 +00:00
|
|
|
'messages' => array(
|
|
|
|
'echo-link-new',
|
2012-07-30 21:38:25 +00:00
|
|
|
'echo-link',
|
2012-06-08 05:55:01 +00:00
|
|
|
'echo-overlay-title',
|
2012-12-17 21:58:18 +00:00
|
|
|
'echo-overlay-title-overflow',
|
2012-06-08 05:55:01 +00:00
|
|
|
'echo-overlay-link',
|
|
|
|
'echo-none',
|
|
|
|
),
|
2012-06-01 10:57:09 +00:00
|
|
|
),
|
|
|
|
'ext.echo.special' => $echoResourceTemplate + array(
|
2012-12-07 01:08:33 +00:00
|
|
|
'scripts' => array(
|
|
|
|
'special/ext.echo.special.js',
|
|
|
|
),
|
|
|
|
'styles' => 'special/ext.echo.special.css',
|
2012-07-31 00:29:49 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'ext.echo.base',
|
2012-12-07 01:08:33 +00:00
|
|
|
'mediawiki.api',
|
|
|
|
'mediawiki.jqueryMsg',
|
2012-07-31 00:29:49 +00:00
|
|
|
'ext.echo.icons',
|
|
|
|
),
|
2012-12-07 01:08:33 +00:00
|
|
|
'messages' => array(
|
|
|
|
'echo-load-more-error',
|
2013-01-04 21:56:30 +00:00
|
|
|
'echo-more-info',
|
2012-12-07 01:08:33 +00:00
|
|
|
),
|
2012-07-31 00:29:49 +00:00
|
|
|
),
|
|
|
|
'ext.echo.icons' => $echoResourceTemplate + array(
|
|
|
|
'styles' => 'icons/icons.css',
|
2012-04-27 15:14:24 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This Echo hook can be used to define users who are by default interested in
|
|
|
|
* certain events.
|
|
|
|
* For example, it can be used to say that users are by default interested in
|
|
|
|
* their own user talk page being edited. In fact, that is what it is used for
|
|
|
|
* internally.
|
|
|
|
*/
|
2012-10-22 20:40:58 +00:00
|
|
|
$wgHooks['EchoGetDefaultNotifiedUsers'][] = 'EchoHooks::getDefaultNotifiedUsers';
|
|
|
|
$wgHooks['EchoGetNotificationTypes'][] = 'EchoHooks::getNotificationTypes';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Hook appropriate events
|
|
|
|
$wgHooks['ArticleSaveComplete'][] = 'EchoHooks::onArticleSaved';
|
2012-08-31 23:35:16 +00:00
|
|
|
$wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
|
2012-07-18 19:39:33 +00:00
|
|
|
$wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-12-19 22:35:45 +00:00
|
|
|
// Disable ordinary user talk page email notifications
|
|
|
|
$wgHooks['AbortEmailNotification'][] = 'EchoHooks::disableStandUserTalkEnotif';
|
|
|
|
$wgHooks['UpdateUserMailerFormattedPageStatus'][] = 'EchoHooks::disableStandUserTalkEnotif';
|
2012-07-31 20:44:43 +00:00
|
|
|
// Disable the yellow bar of death
|
2012-11-01 21:59:53 +00:00
|
|
|
$wgHooks['ArticleEditUpdateNewTalk'][] = 'EchoHooks::abortNewTalkNotification';
|
2012-12-26 22:05:29 +00:00
|
|
|
$wgHooks['LinksUpdateAfterInsert'][] = 'EchoHooks::onLinksUpdateAfterInsert';
|
2012-07-17 22:19:32 +00:00
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// Configuration
|
|
|
|
|
2012-11-27 01:53:35 +00:00
|
|
|
// Whether to turn on email batch function
|
|
|
|
$wgEchoEnableEmailBatch = true;
|
2012-11-13 23:06:11 +00:00
|
|
|
|
2012-12-12 02:18:51 +00:00
|
|
|
// Show a 'Notifications' link with badge in the user toolbar at the top of the page.
|
|
|
|
// Otherwise, only show a badge next to the username.
|
2012-12-27 14:11:03 +00:00
|
|
|
$wgEchoShowFullNotificationsLink = false;
|
2012-12-12 02:18:51 +00:00
|
|
|
|
2013-01-04 21:56:30 +00:00
|
|
|
// URL for more information about the Echo notification system
|
|
|
|
$wgEchoHelpPage = '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Echo';
|
|
|
|
|
2012-12-19 20:28:17 +00:00
|
|
|
// Whether to use job queue to process web and email notifications, bypass the queue for now
|
|
|
|
// since it's taking more than an hour to run in mediawiki.org, this is not acceptable for the
|
|
|
|
// purpose of testing notification.
|
|
|
|
// Todo - Abstract this into classes like: JobQueueNone, JobQueueMySQL, JobQueueRedis
|
|
|
|
$wgEchoUseJobQueue = false;
|
|
|
|
|
2012-10-25 20:39:41 +00:00
|
|
|
// The organization address, the value should be defined in LocalSettings.php
|
|
|
|
$wgEchoEmailFooterAddress = '';
|
2012-08-02 19:50:46 +00:00
|
|
|
|
2012-11-13 23:06:11 +00:00
|
|
|
// The max notification count showed in badge
|
|
|
|
$wgEchoMaxNotificationCount = 99;
|
|
|
|
|
2012-08-31 23:35:16 +00:00
|
|
|
$wgEchoDefaultNotificationTypes = array( // Welcome events do not use subscription, and will only trigger notify, not email.
|
2012-04-27 15:14:24 +00:00
|
|
|
'all' => array(
|
|
|
|
'notify' => true,
|
2012-05-17 15:36:18 +00:00
|
|
|
'email' => true,
|
2012-07-18 19:39:33 +00:00
|
|
|
)
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
2012-11-16 21:03:57 +00:00
|
|
|
// Definitions of the different types of notification delivery that are possible.
|
|
|
|
// Each definition consists of a class name and a function name.
|
|
|
|
// See also: EchoNotificationController class.
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgEchoNotifiers = array(
|
2012-11-16 21:03:57 +00:00
|
|
|
'notify' => array( 'EchoNotifier', 'notifyWithNotification' ), // web-based notification
|
2012-08-30 16:04:39 +00:00
|
|
|
'email' => array( 'EchoNotifier', 'notifyWithEmail' ),
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
2012-11-01 21:59:53 +00:00
|
|
|
// Event types that should have notifications enabled.
|
|
|
|
// The list here only includes event types handled by Echo itself. Other
|
|
|
|
// extensions can add to this list through the BeforeCreateEchoEvent hook.
|
2012-08-01 18:20:21 +00:00
|
|
|
$wgEchoEnabledEvents = array(
|
2012-11-16 21:03:57 +00:00
|
|
|
'welcome', // A user created an account
|
|
|
|
'edit-user-talk', // User talk page is edited
|
|
|
|
'reverted', // An edit is undone or rolled-back
|
2012-12-26 22:05:29 +00:00
|
|
|
'article-linked', // A page a user created is linked from another page
|
2012-11-16 21:03:57 +00:00
|
|
|
// These aren't ready yet, specifically they have no means of subscription
|
|
|
|
# 'add-comment', // A signed comment is added to an existing section
|
|
|
|
# 'add-talkpage-topic', // A new section is added to a talk page
|
2012-08-01 18:20:21 +00:00
|
|
|
);
|
|
|
|
|
2013-01-17 00:31:56 +00:00
|
|
|
// This array stores the configuration info for enabled events.
|
|
|
|
// Possible parameters include category, priority, and usergroups.
|
|
|
|
// If an event is not specified, it means the event belongs to the
|
2012-11-27 01:53:35 +00:00
|
|
|
// 'other' category with priority 10, which is the lowest,
|
2013-01-17 00:31:56 +00:00
|
|
|
// priority is ranging from 1 to 10.
|
|
|
|
// The usergroups param specifies an array of usergroups eligible to recieve the
|
|
|
|
// notification type. If no usergroups parameter exists, all groups are eligible.
|
2012-11-27 01:53:35 +00:00
|
|
|
$wgEchoEventDetails = array(
|
|
|
|
'edit-user-talk' => array(
|
|
|
|
'category' => 'edit-user-talk',
|
|
|
|
'priority' => 1
|
|
|
|
),
|
|
|
|
'reverted' => array(
|
|
|
|
'category' => 'edit-revert',
|
|
|
|
'priority' => 9
|
|
|
|
),
|
2012-12-26 22:05:29 +00:00
|
|
|
'article-linked' => array(
|
|
|
|
'category' => 'cross-reference',
|
|
|
|
'priority' => 5
|
|
|
|
),
|
2012-11-27 01:53:35 +00:00
|
|
|
);
|
|
|
|
|
2012-11-16 21:03:57 +00:00
|
|
|
// Definitions of the notification event types built into Echo
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgEchoNotificationFormatters = array(
|
|
|
|
'edit-user-talk' => array(
|
|
|
|
'type' => 'edit',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-edit-talk-page2',
|
2012-12-18 01:50:00 +00:00
|
|
|
'title-params' => array( 'agent', 'user' ),
|
2012-11-28 02:17:52 +00:00
|
|
|
'payload' => array( 'summary' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-edit-talk-page-flyout2',
|
|
|
|
'flyout-params' => array( 'agent', 'user' ),
|
|
|
|
'email-subject-message' => 'notification-edit-talk-page-email-subject2',
|
|
|
|
'email-body-message' => 'notification-edit-talk-page-email-body2',
|
2012-12-18 01:50:00 +00:00
|
|
|
'email-body-params' => array( 'agent', 'titlelink', 'summary', 'email-footer' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-edit-talk-page-email-batch-body2',
|
2012-11-27 01:53:35 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'difflink', 'summary' ),
|
2012-08-01 18:35:30 +00:00
|
|
|
'icon' => 'chat',
|
2012-04-27 15:14:24 +00:00
|
|
|
),
|
2012-07-27 22:16:19 +00:00
|
|
|
'add-comment' => array(
|
|
|
|
'type' => 'comment',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-add-comment2',
|
|
|
|
'title-message-yours' => 'notification-add-comment-yours2',
|
2012-08-01 21:23:37 +00:00
|
|
|
'title-params' => array( 'agent', 'subject', 'title', 'content-page' ),
|
2012-11-28 02:17:52 +00:00
|
|
|
'payload' => array( 'snippet' ),
|
2012-08-01 18:35:30 +00:00
|
|
|
'icon' => 'chat',
|
2012-07-27 22:16:19 +00:00
|
|
|
),
|
|
|
|
'add-talkpage-topic' => array(
|
|
|
|
'type' => 'comment',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-add-talkpage-topic2',
|
|
|
|
'title-message-yours' => 'notification-add-talkpage-topic-yours2',
|
2012-08-01 21:23:37 +00:00
|
|
|
'title-params' => array( 'agent', 'subject', 'title', 'content-page' ),
|
2012-11-28 02:17:52 +00:00
|
|
|
'payload' => array( 'snippet' ),
|
2012-08-01 18:35:30 +00:00
|
|
|
'icon' => 'chat',
|
2012-07-27 22:16:19 +00:00
|
|
|
),
|
2012-08-31 23:35:16 +00:00
|
|
|
'welcome' => array(
|
|
|
|
'type' => 'welcome',
|
|
|
|
'title-message' => 'notification-new-user',
|
|
|
|
'title-params' => array( 'agent' ),
|
2012-11-28 02:17:52 +00:00
|
|
|
'payload' => array( 'welcome' ),
|
2012-08-31 23:35:16 +00:00
|
|
|
'icon' => 'w',
|
2012-07-18 19:39:33 +00:00
|
|
|
),
|
|
|
|
'reverted' => array(
|
|
|
|
'type' => 'edit',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-reverted2',
|
2012-12-10 05:01:00 +00:00
|
|
|
'title-params' => array( 'agent', 'title', 'difflink', 'number' ),
|
2012-11-28 02:17:52 +00:00
|
|
|
'payload' => array( 'summary' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-reverted-flyout2',
|
|
|
|
'flyout-params' => array( 'agent', 'title', 'difflink', 'number' ),
|
|
|
|
'email-subject-message' => 'notification-reverted-email-subject2',
|
2012-12-28 23:43:20 +00:00
|
|
|
'email-subject-params' => array( 'agent', 'title', 'number' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-message' => 'notification-reverted-email-body2',
|
2012-12-28 23:43:20 +00:00
|
|
|
'email-body-params' => array( 'agent', 'title', 'difflink', 'user', 'summary', 'email-footer', 'number' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-reverted-email-batch-body2',
|
2012-12-28 23:43:20 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'number' ),
|
2012-07-18 19:39:33 +00:00
|
|
|
'icon' => 'revert',
|
2012-12-26 22:05:29 +00:00
|
|
|
),
|
|
|
|
'article-linked' => array(
|
|
|
|
'class' => 'MWEchoArticleLinkedFormatter',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-article-linked2',
|
|
|
|
'title-params' => array( 'agent', 'title', 'title-linked' ),
|
2012-12-26 22:05:29 +00:00
|
|
|
'payload' => array( 'summary' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-article-linked-flyout2',
|
|
|
|
'flyout-params' => array( 'agent', 'title', 'title-linked' ),
|
|
|
|
'email-subject-message' => 'notification-article-linked-email-subject2',
|
2012-12-26 22:05:29 +00:00
|
|
|
'email-subject-params' => array( 'title-linked' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-message' => 'notification-article-linked-email-body2',
|
2012-12-26 22:05:29 +00:00
|
|
|
'email-body-params' => array( 'agent', 'title', 'titlelink', 'title-linked', 'email-footer' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-article-linked-email-batch-body2',
|
2012-12-26 22:05:29 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'title-linked' ),
|
|
|
|
'icon' => 'linked',
|
|
|
|
),
|
2012-06-08 05:33:25 +00:00
|
|
|
);
|
2013-01-17 23:06:40 +00:00
|
|
|
|
|
|
|
// Enable notifications for all logged in users by default
|
|
|
|
$wgDefaultUserOptions['echo-notify-link'] = 'true';
|
|
|
|
|
|
|
|
// By default, send emails for each notification as they come in
|
|
|
|
$wgDefaultUserOptions['echo-email-frequency'] = EchoHooks::EMAIL_IMMEDIATELY;
|
|
|
|
|
|
|
|
// Set all of the events to email by default (won't affect events that don't email)
|
|
|
|
foreach ( $wgEchoEnabledEvents as $wgEchoEnabledEvent ) {
|
|
|
|
$wgDefaultUserOptions['echo-email-notifications' . $wgEchoEnabledEvent] = true;
|
|
|
|
}
|
|
|
|
// unset default email for reverted, article-linked (change them to opt-in)
|
|
|
|
$wgDefaultUserOptions['echo-email-notificationsreverted'] = false;
|
|
|
|
$wgDefaultUserOptions['echo-email-notificationsarticle-linked'] = false;
|