Replace use of deprecated User::isBlockedFromEmailuser()

Change-Id: Ic03e63d4585416fa60f602b3d42faaafe8559118
这个提交包含在:
Taavi Väänänen 2024-04-23 19:22:32 +03:00
父节点 8e3a7b3c93
当前提交 734a795fc3
找不到此签名对应的密钥
GPG 密钥 ID: EF242F709F912FBE
共有 1 个文件被更改,包括 4 次插入5 次删除

查看文件

@ -157,17 +157,16 @@ class SpecialContact extends UnlistedSpecialPage {
}
// Blocked users cannot use the contact form if they're disabled from sending email.
if ( $user->isBlockedFromEmailuser() ) {
$block = $user->getBlock();
if ( $block && $block->appliesToRight( 'sendemail' ) ) {
$useCustomBlockMessage = $config['UseCustomBlockMessage'] ?? false;
if ( $useCustomBlockMessage ) {
$this->getOutput()->showErrorPage( $this->getFormSpecificMessageKey( 'contactpage-title' ),
$this->getFormSpecificMessageKey( 'contactpage-blocked-message' ) );
return;
} else {
// If the user is blocked from emailing users then there is a block
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable
throw new UserBlockedError( $this->getUser()->getBlock() );
}
throw new UserBlockedError( $block );
}
$this->getOutput()->setPageTitleMsg(