Disable reply links on mobile

Bug: T270088
Change-Id: I003b0c6adea8496c95596e40a2bf4bb63906a464
This commit is contained in:
Ed Sanders 2020-12-14 18:52:47 +00:00
parent 7706c391d2
commit ccf6f33c40

View file

@ -11,6 +11,7 @@ namespace MediaWiki\Extension\DiscussionTools;
use Action;
use ConfigException;
use ExtensionRegistry;
use MediaWiki\MediaWikiServices;
use MWExceptionHandler;
use OutputPage;
@ -69,6 +70,14 @@ class Hooks {
return false;
}
// Don't show on mobile
if ( ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) ) {
$mobFrontContext = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' );
if ( $mobFrontContext->shouldDisplayMobileView() ) {
return false;
}
}
$title = $output->getTitle();
// Only wikitext pages (e.g. not Flow boards)
if ( $title->getContentModel() !== CONTENT_MODEL_WIKITEXT ) {