*/
$wgEnableUserEmail = true;
+ /**
+ * Set to true to enable user-to-user e-mail blacklist.
+ *
+ * @since 1.30
+ */
+ $wgEnableUserEmailBlacklist = false;
+
/**
* If true put the sending user's email in a Reply-To header
* instead of From (false). ($wgPasswordSender will be used as From.)
*/
$wgStructuredChangeFiltersEnableExperimentalViews = false;
-/**
- * Whether to allow users to use the experimental live update feature in the new RecentChanges UI
- *
- * Temporary variable during development and will be removed.
- */
-$wgStructuredChangeFiltersEnableLiveUpdate = false;
-
/**
* Whether to enable RCFilters app on Special:Watchlist
*
'label-message' => 'tog-ccmeonemails',
'disabled' => $disableEmailPrefs,
];
+
+ if ( $config->get( 'EnableUserEmailBlacklist' )
+ && !$disableEmailPrefs
+ && !(bool)$user->getOption( 'disablemail' )
+ ) {
+ $lookup = CentralIdLookup::factory();
+ $ids = $user->getOption( 'email-blacklist', [] );
+ $names = $ids ? $lookup->namesFromCentralIds( $ids, $user ) : [];
+
+ $defaultPreferences['email-blacklist'] = [
+ 'type' => 'usersmultiselect',
+ 'label-message' => 'email-blacklist-label',
+ 'section' => 'personal/email',
+ 'default' => implode( "\n", $names ),
+ ];
+ }
}
if ( $config->get( 'EnotifWatchlist' ) ) {
$htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() );
# Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
$htmlForm->setSubmitTooltip( 'preferences-save' );
- $htmlForm->setSubmitID( 'prefsubmit' );
+ $htmlForm->setSubmitID( 'prefcontrol' );
$htmlForm->setSubmitCallback( [ 'Preferences', 'tryFormSubmit' ] );
return $htmlForm;
$targetUser = User::newFromId( $id );
}
- # The sending user must have a confirmed email address and the target
- # user must have a confirmed email address and allow emails from users.
- return $this->getUser()->canSendEmail() &&
- $targetUser->canReceiveEmail();
+ # The sending user must have a confirmed email address and the receiving
+ # user must accept emails from the sender.
+ return $this->getUser()->canSendEmail()
+ && SpecialEmailUser::validateTarget( $targetUser, $this->getUser() ) === '';
}
/**
$attribs = [];
if ( !is_null( $tooltip ) ) {
- # T27462: undo double-escaping.
- $tooltip = Sanitizer::decodeCharReferences( $tooltip );
$attribs['title'] = wfMessage( 'editsectionhint' )->rawParams( $tooltip )
->inLanguage( $lang )->text();
}