2012-04-27 15:14:24 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* MediaWiki Extension: Echo
|
2013-08-28 17:38:52 +00:00
|
|
|
* http://www.mediawiki.org/wiki/Extension:Echo
|
2012-04-27 15:14:24 +00:00
|
|
|
*
|
|
|
|
* 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
|
2013-08-28 17:38:52 +00:00
|
|
|
* @author Andrew Garrett, Benny Situ, Ryan Kaldari, Erik Bernhardson
|
|
|
|
* @licence MIT License
|
2012-04-27 15:14:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
# 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',
|
2015-01-29 13:58:09 +00:00
|
|
|
'license-name' => 'MIT',
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
2014-03-26 14:22:57 +00:00
|
|
|
$wgMessagesDirs['Echo'] = __DIR__ . '/i18n';
|
2015-06-16 00:45:03 +00:00
|
|
|
$wgExtensionMessagesFiles['EchoAliases'] = __DIR__ . '/Echo.alias.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2014-09-26 21:42:19 +00:00
|
|
|
// This file is autogenerated by scripts/gen-autoload.php
|
|
|
|
require __DIR__ . "/autoload.php";
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2014-09-26 21:42:19 +00:00
|
|
|
// Queable jobs
|
2012-06-06 07:04:28 +00:00
|
|
|
$wgJobClasses['EchoNotificationJob'] = 'EchoNotificationJob';
|
2013-03-06 00:04:48 +00:00
|
|
|
$wgJobClasses['MWEchoNotificationEmailBundleJob'] = 'MWEchoNotificationEmailBundleJob';
|
2014-09-09 22:11:53 +00:00
|
|
|
// Job to delete older notifications
|
|
|
|
$wgJobClasses['EchoNotificationDeleteJob'] = 'EchoNotificationDeleteJob';
|
2012-06-06 07:04:28 +00:00
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// API
|
|
|
|
$wgAPIMetaModules['notifications'] = 'ApiEchoNotifications';
|
2013-09-18 21:10:37 +00:00
|
|
|
$wgAPIModules['echomarkread'] = 'ApiEchoMarkRead';
|
2015-04-29 12:08:30 +00:00
|
|
|
$wgAPIModules['echomarkseen'] = 'ApiEchoMarkSeen';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Special page
|
|
|
|
$wgSpecialPages['Notifications'] = 'SpecialNotifications';
|
|
|
|
|
|
|
|
// Housekeeping hooks
|
2015-06-02 00:28:25 +00:00
|
|
|
$wgHooks['LoadExtensionSchemaUpdates'][] = 'EchoHooks::onLoadExtensionSchemaUpdates';
|
2012-04-27 15:14:24 +00:00
|
|
|
$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';
|
2013-03-01 00:26:59 +00:00
|
|
|
$wgHooks['ResourceLoaderRegisterModules'][] = 'EchoHooks::onResourceLoaderRegisterModules';
|
2015-06-01 18:58:37 +00:00
|
|
|
$wgHooks['EventLoggingRegisterSchemas'][] = 'EchoHooks::onEventLoggingRegisterSchemas';
|
2014-08-05 22:18:38 +00:00
|
|
|
$wgHooks['ResourceLoaderTestModules'][] = 'EchoHooks::onResourceLoaderTestModules';
|
2015-09-22 18:16:59 +00:00
|
|
|
$wgHooks['UserGroupsChanged'][] = 'EchoHooks::onUserGroupsChanged';
|
2013-04-30 02:53:33 +00:00
|
|
|
$wgHooks['UserLoadOptions'][] = 'EchoHooks::onUserLoadOptions';
|
|
|
|
$wgHooks['UserSaveOptions'][] = 'EchoHooks::onUserSaveOptions';
|
2013-05-24 22:51:47 +00:00
|
|
|
$wgHooks['UserClearNewTalkNotification'][] = 'EchoHooks::onUserClearNewTalkNotification';
|
2014-06-26 01:04:31 +00:00
|
|
|
$wgHooks['ParserTestTables'][] = 'EchoHooks::onParserTestTables';
|
2015-09-19 20:49:34 +00:00
|
|
|
$wgHooks['EmailUserComplete'][] = 'EchoHooks::onEmailUserComplete';
|
2012-06-01 10:57:09 +00:00
|
|
|
|
2014-08-26 03:09:46 +00:00
|
|
|
// Extension:UserMerge support
|
|
|
|
$wgHooks['UserMergeAccountFields'][] = 'EchoHooks::onUserMergeAccountFields';
|
|
|
|
$wgHooks['MergeAccountFromTo'][] = 'EchoHooks::onMergeAccountFromTo';
|
|
|
|
$wgHooks['UserMergeAccountDeleteTables'][] = 'EchoHooks::onUserMergeAccountDeleteTables';
|
|
|
|
|
2013-01-15 23:21:39 +00:00
|
|
|
// Extension initialization
|
|
|
|
$wgExtensionFunctions[] = 'EchoHooks::initEchoExtension';
|
|
|
|
|
2015-06-02 00:26:36 +00:00
|
|
|
require __DIR__ . '/Resources.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2013-01-15 23:21:39 +00:00
|
|
|
$wgHooks['EchoGetBundleRules'][] = 'EchoHooks::onEchoGetBundleRules';
|
2013-05-01 19:27:32 +00:00
|
|
|
$wgHooks['EchoAbortEmailNotification'][] = 'EchoHooks::onEchoAbortEmailNotification';
|
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';
|
2013-04-12 22:12:22 +00:00
|
|
|
$wgHooks['UserSaveSettings'][] = 'EchoHooks::onUserSaveSettings';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-12-19 22:35:45 +00:00
|
|
|
// Disable ordinary user talk page email notifications
|
2013-06-08 01:05:35 +00:00
|
|
|
$wgHooks['AbortTalkPageEmailNotification'][] = 'EchoHooks::onAbortTalkPageEmailNotification';
|
2014-02-21 01:48:08 +00:00
|
|
|
$wgHooks['SendWatchlistEmailNotification'][] = 'EchoHooks::onSendWatchlistEmailNotification';
|
2015-06-01 23:59:03 +00:00
|
|
|
// Disable the orange bar of death
|
2013-05-05 00:49:08 +00:00
|
|
|
$wgHooks['GetNewMessagesAlert'][] = 'EchoHooks::abortNewMessagesAlert';
|
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
|
|
|
|
2013-01-04 21:56:30 +00:00
|
|
|
// URL for more information about the Echo notification system
|
2015-02-26 20:18:35 +00:00
|
|
|
$wgEchoHelpPage = '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Notifications';
|
2013-01-04 21:56:30 +00:00
|
|
|
|
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.
|
|
|
|
$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
|
|
|
|
2013-04-17 16:26:05 +00:00
|
|
|
// The email address for both "from" and "reply to" on email notifications.
|
|
|
|
// Should be defined in LocalSettings.php
|
|
|
|
$wgNotificationSender = $wgPasswordSender;
|
|
|
|
// Name for "from" on email notifications. Should be defined in LocalSettings.php
|
2014-02-25 06:09:27 +00:00
|
|
|
// if null, uses 'emailsender' message
|
|
|
|
$wgNotificationSenderName = null;
|
2013-04-17 16:26:05 +00:00
|
|
|
// Name for "reply to" on email notifications. Should be defined in LocalSettings.php
|
|
|
|
$wgNotificationReplyName = 'No Reply';
|
|
|
|
|
2013-04-09 22:13:39 +00:00
|
|
|
// Use the main db if this is set to false, to use a specific external db, just
|
|
|
|
// use any key defined in $wgExternalServers
|
|
|
|
$wgEchoCluster = false;
|
|
|
|
|
2012-11-13 23:06:11 +00:00
|
|
|
// The max notification count showed in badge
|
2013-01-15 23:21:39 +00:00
|
|
|
// The max number showed in bundled message, eg, <user> and 99+ others <action>
|
2012-11-13 23:06:11 +00:00
|
|
|
$wgEchoMaxNotificationCount = 99;
|
|
|
|
|
2014-09-09 22:11:53 +00:00
|
|
|
// The max number of notifications allowed for a user to do a live update,
|
|
|
|
// this is also the number of max notifications allowed for a user to have
|
|
|
|
// @FIXME - the name is not intuitive, probably change it when the deleteJob patch
|
|
|
|
// is deployed to both deployment branches
|
2014-08-13 22:00:25 +00:00
|
|
|
$wgEchoMaxUpdateCount = 2000;
|
|
|
|
|
2013-03-06 00:04:48 +00:00
|
|
|
// The time interval between each bundle email in seconds
|
|
|
|
// set a small number for test wikis, should set this to 0 to disable email bundling
|
|
|
|
// if there is no delay queue support
|
|
|
|
$wgEchoBundleEmailInterval = 0;
|
|
|
|
|
2013-05-14 07:05:09 +00:00
|
|
|
// Whether or not to enable a new talk page message alert for logged in users
|
|
|
|
$wgEchoNewMsgAlert = true;
|
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Define which output formats are available for each notification category
|
2013-01-14 23:52:46 +00:00
|
|
|
$wgEchoDefaultNotificationTypes = array(
|
2012-04-27 15:14:24 +00:00
|
|
|
'all' => array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'web' => true,
|
2012-05-17 15:36:18 +00:00
|
|
|
'email' => true,
|
2013-02-16 02:20:34 +00:00
|
|
|
),
|
2014-08-02 06:52:16 +00:00
|
|
|
// Only send web notification for welcome event
|
|
|
|
'welcome' => array(
|
|
|
|
'email' => false,
|
|
|
|
),
|
2015-09-19 20:49:34 +00:00
|
|
|
// No need to get a email when another user sends to me
|
|
|
|
'emailuser' => array(
|
|
|
|
'web' => true,
|
|
|
|
'email' => false,
|
|
|
|
),
|
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(
|
2013-01-14 23:52:46 +00:00
|
|
|
'web' => 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
|
|
|
);
|
|
|
|
|
2013-05-06 22:34:50 +00:00
|
|
|
// List of usernames that will not trigger notification creation. This is initially
|
|
|
|
// for bots that perform automated edits that are not important enough to regularly
|
|
|
|
// spam people with notifications. Set to empty array when not in use.
|
|
|
|
$wgEchoAgentBlacklist = array();
|
|
|
|
|
|
|
|
// Page location of community maintained blacklist within NS_MEDIAWIKI. Set to null to disable.
|
|
|
|
$wgEchoOnWikiBlacklist = 'Echo-blacklist';
|
|
|
|
|
|
|
|
// sprintf format of per-user notification agent whitelists. Set to null to disable.
|
|
|
|
$wgEchoPerUserWhitelistFormat = '%s/Echo-whitelist';
|
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Define the categories that notifications can belong to. Categories can be
|
2013-05-02 00:12:59 +00:00
|
|
|
// assigned the following parameters: priority, nodismiss, tooltip, and usergroups.
|
|
|
|
// All parameters are optional.
|
2013-02-16 02:20:34 +00:00
|
|
|
// If a notifications type doesn't have a category parameter, it is
|
|
|
|
// automatically assigned to the 'other' category which is lowest priority and
|
|
|
|
// has no preferences or dismissibility.
|
|
|
|
// The priority parameter controls the order in which notifications are
|
|
|
|
// displayed in preferences and batch emails. Priority ranges from 1 to 10. If
|
|
|
|
// the priority is not specified, it defaults to 10, which is the lowest.
|
2013-01-17 00:31:56 +00:00
|
|
|
// The usergroups param specifies an array of usergroups eligible to recieve the
|
2013-02-16 02:20:34 +00:00
|
|
|
// notifications in the category. If no usergroups parameter is specified, all
|
|
|
|
// groups are eligible.
|
|
|
|
// The nodismiss parameter disables the dismissability of notifications in the
|
|
|
|
// category. It can either be set to an array of output formats (see
|
|
|
|
// $wgEchoNotifiers) or an array containing 'all'.
|
|
|
|
$wgEchoNotificationCategories = array(
|
|
|
|
'system' => array(
|
|
|
|
'priority' => 9,
|
|
|
|
'no-dismiss' => array( 'all' ),
|
|
|
|
),
|
2013-10-25 02:25:42 +00:00
|
|
|
'user-rights' => array( // bug 55337
|
|
|
|
'priority' => 9,
|
|
|
|
'tooltip' => 'echo-pref-tooltip-user-rights',
|
|
|
|
),
|
2013-02-16 02:20:34 +00:00
|
|
|
'other' => array(
|
|
|
|
'no-dismiss' => array( 'all' ),
|
2013-01-14 23:52:46 +00:00
|
|
|
),
|
2012-11-27 01:53:35 +00:00
|
|
|
'edit-user-talk' => array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'priority' => 1,
|
2013-02-16 02:20:34 +00:00
|
|
|
'no-dismiss' => array( 'web' ),
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-edit-user-talk',
|
2012-11-27 01:53:35 +00:00
|
|
|
),
|
|
|
|
'reverted' => array(
|
2012-10-28 16:47:41 +00:00
|
|
|
'priority' => 9,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-reverted',
|
2012-11-27 01:53:35 +00:00
|
|
|
),
|
2012-12-26 22:05:29 +00:00
|
|
|
'article-linked' => array(
|
2012-10-28 16:47:41 +00:00
|
|
|
'priority' => 5,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-article-linked',
|
2012-10-28 16:47:41 +00:00
|
|
|
),
|
|
|
|
'mention' => array(
|
|
|
|
'priority' => 4,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-mention',
|
2012-12-26 22:05:29 +00:00
|
|
|
),
|
2015-09-19 20:49:34 +00:00
|
|
|
'emailuser' => array(
|
|
|
|
'priority' => 9,
|
|
|
|
'tooltip' => 'echo-pref-tooltip-emailuser',
|
|
|
|
),
|
2012-11-27 01:53:35 +00:00
|
|
|
);
|
|
|
|
|
2013-04-29 03:40:56 +00:00
|
|
|
$echoIconPath = "Echo/modules/icons";
|
|
|
|
|
|
|
|
// Defines icons, which are 30x30 images. This is passed to BeforeCreateEchoEvent so
|
|
|
|
// extensions can define their own icons with the same structure. It is recommended that
|
|
|
|
// extensions prefix their icon key. An example is myextension-name. This will help
|
|
|
|
// avoid namespace conflicts.
|
|
|
|
//
|
|
|
|
// You can use either a path or a url, but not both.
|
|
|
|
// The value of 'path' is relative to $wgExtensionAssetsPath.
|
|
|
|
//
|
|
|
|
// The value of 'url' should be a URL.
|
|
|
|
//
|
|
|
|
// You should customize the site icon URL, which is:
|
|
|
|
// $wgEchoNotificationIcons['site']['url']
|
|
|
|
$wgEchoNotificationIcons = array(
|
|
|
|
'placeholder' => array(
|
|
|
|
'path' => "$echoIconPath/Generic.png",
|
|
|
|
),
|
|
|
|
'trash' => array(
|
|
|
|
'path' => "$echoIconPath/Deletion.png",
|
|
|
|
),
|
|
|
|
'chat' => array(
|
|
|
|
'path' => "$echoIconPath/Talk.png",
|
|
|
|
),
|
|
|
|
'linked' => array(
|
|
|
|
'path' => "$echoIconPath/CrossReferenced.png",
|
|
|
|
),
|
|
|
|
'featured' => array(
|
|
|
|
'path' => "$echoIconPath/Featured.png",
|
|
|
|
),
|
|
|
|
'reviewed' => array(
|
|
|
|
'path' => "$echoIconPath/Reviewed.png",
|
|
|
|
),
|
|
|
|
'tagged' => array(
|
|
|
|
'path' => "$echoIconPath/ReviewedWithTags.png",
|
|
|
|
),
|
|
|
|
'revert' => array(
|
|
|
|
'path' => "$echoIconPath/Revert.png",
|
|
|
|
),
|
|
|
|
'checkmark' => array(
|
|
|
|
'path' => "$echoIconPath/Reviewed.png",
|
|
|
|
),
|
|
|
|
'gratitude' => array(
|
|
|
|
'path' => "$echoIconPath/Gratitude.png",
|
|
|
|
),
|
|
|
|
'site' => array(
|
|
|
|
'url' => false
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2013-02-15 23:34:47 +00:00
|
|
|
// Definitions of the notification event types built into Echo.
|
|
|
|
// If formatter-class isn't specified, defaults to EchoBasicFormatter.
|
2013-02-16 02:20:34 +00:00
|
|
|
$wgEchoNotifications = array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'welcome' => array(
|
2014-07-31 02:31:47 +00:00
|
|
|
'user-locators' => array(
|
|
|
|
'EchoUserLocator::locateEventAgent'
|
|
|
|
),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'system',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'positive',
|
2014-08-05 21:50:54 +00:00
|
|
|
'section' => 'alert',
|
2013-01-14 23:52:46 +00:00
|
|
|
'title-message' => 'notification-new-user',
|
|
|
|
'title-params' => array( 'agent' ),
|
2013-04-29 03:40:56 +00:00
|
|
|
'icon' => 'site',
|
2013-01-14 23:52:46 +00:00
|
|
|
),
|
2012-04-27 15:14:24 +00:00
|
|
|
'edit-user-talk' => array(
|
2014-07-29 23:54:00 +00:00
|
|
|
'user-locators' => array(
|
|
|
|
'EchoUserLocator::locateTalkPageOwner',
|
|
|
|
),
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-message', 'destination' => 'section' ),
|
|
|
|
'secondary-link' => array( 'message' => 'notification-link-text-view-changes', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'edit-user-talk',
|
|
|
|
'group' => 'interactive',
|
2015-08-15 01:51:11 +00:00
|
|
|
'section' => 'message',
|
2013-01-15 23:21:39 +00:00
|
|
|
'bundle' => array( 'web' => true, 'email' => false ),
|
2013-07-24 03:50:43 +00:00
|
|
|
'formatter-class' => 'EchoEditUserTalkFormatter',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-edit-talk-page2',
|
2013-05-14 22:22:52 +00:00
|
|
|
'title-params' => array( 'agent', 'user', 'subject-anchor' ),
|
2013-01-15 23:21:39 +00:00
|
|
|
'bundle-message' => 'notification-edit-talk-page-bundle',
|
|
|
|
'bundle-params' => array( 'agent', 'user', 'agent-other-display', 'agent-other-count' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-edit-talk-page-flyout2',
|
2013-05-14 22:22:52 +00:00
|
|
|
'flyout-params' => array( 'agent', 'user', 'subject-anchor' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-subject-message' => 'notification-edit-talk-page-email-subject2',
|
2013-06-24 00:22:08 +00:00
|
|
|
'email-subject-params' => array( 'agent' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-edit-talk-page-email-batch-body2',
|
2013-03-06 00:04:48 +00:00
|
|
|
'email-body-batch-params' => array( 'agent' ),
|
|
|
|
'email-body-batch-bundle-message' => 'notification-edit-user-talk-email-batch-bundle-body',
|
|
|
|
'email-body-batch-bundle-params' => array( 'agent', 'agent-other-display', 'agent-other-count' ),
|
2012-08-01 18:35:30 +00:00
|
|
|
'icon' => 'chat',
|
2015-07-02 03:36:47 +00:00
|
|
|
'immediate' => true,
|
2012-04-27 15:14:24 +00:00
|
|
|
),
|
2012-07-18 19:39:33 +00:00
|
|
|
'reverted' => array(
|
2014-07-31 02:31:47 +00:00
|
|
|
'user-locators' => array(
|
2014-07-30 03:18:48 +00:00
|
|
|
array( 'EchoUserLocator::locateFromEventExtra', array( 'reverted-user-id' ) ),
|
2014-07-31 02:31:47 +00:00
|
|
|
),
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-edit', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'reverted',
|
|
|
|
'group' => 'negative',
|
2014-08-05 21:50:54 +00:00
|
|
|
'section' => 'alert',
|
2013-02-15 23:34:47 +00:00
|
|
|
'formatter-class' => 'EchoEditFormatter',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-reverted2',
|
2015-09-17 22:59:57 +00:00
|
|
|
'title-params' => array( 'agent', 'title', 'difflink', 'number', 'userpage-contributions' ),
|
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-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
|
|
|
),
|
2013-01-15 23:21:39 +00:00
|
|
|
'page-linked' => array(
|
2014-07-31 02:31:47 +00:00
|
|
|
'user-locators' => array(
|
|
|
|
'EchoUserLocator::locateArticleCreator',
|
|
|
|
),
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-page', 'destination' => 'link-from-page' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'article-linked',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'neutral',
|
2014-08-05 21:50:54 +00:00
|
|
|
'section' => 'alert',
|
2013-03-06 00:04:48 +00:00
|
|
|
'bundle' => array( 'web' => true, 'email' => true ),
|
2013-01-15 23:21:39 +00:00
|
|
|
'formatter-class' => 'EchoPageLinkFormatter',
|
|
|
|
'title-message' => 'notification-page-linked',
|
|
|
|
'title-params' => array( 'agent', 'title', 'link-from-page' ),
|
|
|
|
'bundle-message' => 'notification-page-linked-bundle',
|
|
|
|
'bundle-params' => array( 'agent', 'title', 'link-from-page', 'link-from-page-other-display', 'link-from-page-other-count' ),
|
|
|
|
'flyout-message' => 'notification-page-linked-flyout',
|
|
|
|
'flyout-params' => array( 'agent', 'title', 'link-from-page' ),
|
|
|
|
'email-subject-message' => 'notification-page-linked-email-subject',
|
|
|
|
'email-subject-params' => array(),
|
|
|
|
'email-body-batch-message' => 'notification-page-linked-email-batch-body',
|
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'link-from-page' ),
|
2013-03-06 00:04:48 +00:00
|
|
|
'email-body-batch-bundle-message' => 'notification-page-linked-email-batch-bundle-body',
|
|
|
|
'email-body-batch-bundle-params' => array( 'agent', 'title', 'link-from-page', 'link-from-page-other-display', 'link-from-page-other-count' ),
|
2012-12-26 22:05:29 +00:00
|
|
|
'icon' => 'linked',
|
|
|
|
),
|
2012-10-28 16:47:41 +00:00
|
|
|
'mention' => array(
|
2014-07-31 02:31:47 +00:00
|
|
|
'user-locators' => array(
|
2014-07-30 03:18:48 +00:00
|
|
|
array( 'EchoUserLocator::locateFromEventExtra', array( 'mentioned-users' ) ),
|
2014-07-31 02:31:47 +00:00
|
|
|
),
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-mention', 'destination' => 'section' ),
|
|
|
|
'secondary-link' => array( 'message' => 'notification-link-text-view-changes', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'mention',
|
|
|
|
'group' => 'interactive',
|
2014-08-05 21:50:54 +00:00
|
|
|
'section' => 'alert',
|
2013-11-20 21:52:14 +00:00
|
|
|
'formatter-class' => 'EchoMentionFormatter',
|
2012-10-28 16:47:41 +00:00
|
|
|
'title-message' => 'notification-mention',
|
2013-07-24 03:50:43 +00:00
|
|
|
'title-params' => array( 'agent', 'subject-anchor', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'flyout-message' => 'notification-mention-flyout',
|
2013-07-24 03:50:43 +00:00
|
|
|
'flyout-params' => array( 'agent', 'subject-anchor', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'email-subject-message' => 'notification-mention-email-subject',
|
|
|
|
'email-subject-params' => array( 'agent' ),
|
|
|
|
'email-body-batch-message' => 'notification-mention-email-batch-body',
|
2013-07-24 03:50:43 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'icon' => 'chat',
|
2013-03-13 00:49:19 +00:00
|
|
|
),
|
|
|
|
'user-rights' => array(
|
2014-07-31 02:31:47 +00:00
|
|
|
'user-locators' => array(
|
2014-07-30 03:18:48 +00:00
|
|
|
array( 'EchoUserLocator::locateFromEventExtra', array( 'user' ) ),
|
2014-07-31 02:31:47 +00:00
|
|
|
),
|
2013-08-01 00:18:23 +00:00
|
|
|
'primary-link' => array( 'message' => 'echo-learn-more', 'destination' => 'user-rights-list' ),
|
2013-10-25 02:25:42 +00:00
|
|
|
'category' => 'user-rights',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'neutral',
|
2014-08-05 21:50:54 +00:00
|
|
|
'section' => 'alert',
|
2013-03-13 00:49:19 +00:00
|
|
|
'formatter-class' => 'EchoUserRightsFormatter',
|
|
|
|
'title-message' => 'notification-user-rights',
|
|
|
|
'title-params' => array( 'agent', 'user-rights-list' ),
|
|
|
|
'flyout-message' => 'notification-user-rights-flyout',
|
|
|
|
'flyout-params' => array( 'agent', 'user-rights-list' ),
|
|
|
|
'email-subject-message' => 'notification-user-rights-email-subject',
|
|
|
|
'email-subject-params' => array(),
|
|
|
|
'email-body-batch-message' => 'notification-user-rights-email-batch-body',
|
|
|
|
'email-body-batch-params' => array( 'agent', 'user-rights-list' ),
|
2013-04-29 03:40:56 +00:00
|
|
|
'icon' => 'site',
|
2013-03-13 00:49:19 +00:00
|
|
|
),
|
2015-09-19 20:49:34 +00:00
|
|
|
'emailuser' => array(
|
|
|
|
'user-locators' => array(
|
|
|
|
array( 'EchoUserLocator::locateFromEventExtra', array( 'to-user-id' ) ),
|
|
|
|
),
|
|
|
|
'category' => 'emailuser',
|
|
|
|
'group' => 'neutral',
|
|
|
|
'section' => 'alert',
|
|
|
|
'title-message' => 'notification-emailuser',
|
|
|
|
'title-params' => array( 'agent' ),
|
|
|
|
'flyout-message' => 'notification-emailuser-flyout',
|
|
|
|
'flyout-params' => array( 'agent' ),
|
|
|
|
'icon' => 'site',
|
|
|
|
),
|
2012-06-08 05:33:25 +00:00
|
|
|
);
|
2013-01-17 23:06:40 +00:00
|
|
|
|
2013-05-14 07:05:09 +00:00
|
|
|
// Enable new talk page messages alert for all logged in users by default
|
|
|
|
$wgDefaultUserOptions['echo-show-alert'] = true;
|
|
|
|
|
2013-01-17 23:06:40 +00:00
|
|
|
// By default, send emails for each notification as they come in
|
2013-10-23 19:31:35 +00:00
|
|
|
$wgDefaultUserOptions['echo-email-frequency'] = 0; /*EchoHooks::EMAIL_IMMEDIATELY*/
|
2013-01-17 23:06:40 +00:00
|
|
|
|
2013-06-24 00:22:08 +00:00
|
|
|
if ( $wgAllowHTMLEmail ) {
|
2013-10-23 19:31:35 +00:00
|
|
|
$wgDefaultUserOptions['echo-email-format'] = 'html'; /*EchoHooks::EMAIL_FORMAT_HTML*/
|
2013-06-24 00:22:08 +00:00
|
|
|
} else {
|
2013-10-23 19:31:35 +00:00
|
|
|
$wgDefaultUserOptions['echo-email-format'] = 'plain-text'; /*EchoHooks::EMAIL_FORMAT_PLAIN_TEXT*/
|
2013-06-24 00:22:08 +00:00
|
|
|
}
|
|
|
|
|
2013-04-25 00:41:47 +00:00
|
|
|
// Set all of the events to notify by web but not email by default (won't affect events that don't email)
|
2013-03-06 19:56:23 +00:00
|
|
|
foreach ( $wgEchoNotificationCategories as $category => $categoryData ) {
|
2013-04-25 00:41:47 +00:00
|
|
|
$wgDefaultUserOptions["echo-subscriptions-email-{$category}"] = false;
|
|
|
|
$wgDefaultUserOptions["echo-subscriptions-web-{$category}"] = true;
|
2013-01-17 23:06:40 +00:00
|
|
|
}
|
2013-01-15 23:21:39 +00:00
|
|
|
|
2013-04-27 01:39:11 +00:00
|
|
|
// most settings default to web on, email off, but override these
|
|
|
|
$wgDefaultUserOptions['echo-subscriptions-email-system'] = true;
|
2013-10-25 02:25:42 +00:00
|
|
|
$wgDefaultUserOptions['echo-subscriptions-email-user-rights'] = true;
|
2013-04-25 00:41:47 +00:00
|
|
|
$wgDefaultUserOptions['echo-subscriptions-web-article-linked'] = false;
|
2015-09-19 20:49:34 +00:00
|
|
|
$wgDefaultUserOptions['echo-subscriptions-web-emailuser'] = false;
|
2013-03-01 00:26:59 +00:00
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Echo Configuration for EventLogging
|
2013-03-01 00:26:59 +00:00
|
|
|
$wgEchoConfig = array(
|
2013-10-18 06:51:43 +00:00
|
|
|
'version' => '1.5',
|
2013-03-01 00:26:59 +00:00
|
|
|
'eventlogging' => array (
|
2015-07-08 19:29:00 +00:00
|
|
|
/**
|
|
|
|
* Properties:
|
|
|
|
* - 'enabled': Whether it should be used
|
|
|
|
* - 'revision': revision id of the schema
|
|
|
|
* - 'client': whether the schema is needed client-side
|
|
|
|
*/
|
2013-03-01 00:26:59 +00:00
|
|
|
'Echo' => array (
|
2013-03-06 19:56:23 +00:00
|
|
|
'enabled' => false,
|
2014-02-20 22:40:34 +00:00
|
|
|
'revision' => 7572295,
|
2015-07-08 19:29:00 +00:00
|
|
|
'client' => false,
|
2013-05-07 23:27:46 +00:00
|
|
|
),
|
|
|
|
'EchoMail' => array (
|
|
|
|
'enabled' => false,
|
2015-07-08 19:29:00 +00:00
|
|
|
'revision' => 5467650,
|
|
|
|
'client' => false,
|
2013-05-07 23:27:46 +00:00
|
|
|
),
|
2013-06-05 20:44:06 +00:00
|
|
|
'EchoInteraction' => array (
|
|
|
|
'enabled' => false,
|
2015-07-08 19:29:00 +00:00
|
|
|
'revision' => 5782287,
|
|
|
|
'client' => true,
|
2013-06-05 20:44:06 +00:00
|
|
|
),
|
2013-03-01 00:26:59 +00:00
|
|
|
)
|
|
|
|
);
|