Add hook that allows suppression of the talk page overlay

The hook lets us hand off the decision of whether to suppress this to
DiscussionTools, which has a slightly complex set of feature-tests to do
before deciding. It seems better to leave this disabled only when DT
will actually be stepping in.

Bug: T280051
Change-Id: If6b70fb6d801ac04fa3b70c153a2136d2e302f28
This commit is contained in:
David Lynch 2021-06-08 23:01:43 -05:00
parent 18329d800a
commit 5fb7c116b7

View file

@ -484,6 +484,12 @@ class SkinMinerva extends SkinMustache {
private function isTalkPageWithViewAction() {
$title = $this->getTitle();
// Hook is @unstable and only for use by DiscussionTools. Do not use for any other purpose.
$hookContainer = MediaWikiServices::getInstance()->getHookContainer();
if ( !$hookContainer->run( 'MinervaNeueTalkPageOverlay', [ $title, $this->getOutput() ] ) ) {
return false;
}
return $title->isTalkPage() && Action::getActionName( $this->getContext() ) === "view";
}