Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Hooks\EchoNotificationsHandlers Class Reference

Handlers for client Echo notifications. More...

Public Member Functions

 __construct (RepoLinker $repoLinker, NamespaceChecker $namespaceChecker, RedirectLookup $redirectLookup, UserOptionsManager $userOptionsManager, $siteId, $sendEchoNotification, $repoSiteName)
 
 doLocalUserCreated (User $user, $autocreated)
 
 doWikibaseHandleChange (Change $change)
 

Static Public Member Functions

static factory ()
 TODO: Convert this to a proper hook handler class, register factory with services in extension JSON file.
 
static onEchoGetBundleRules (EchoEvent $event, &$bundleString)
 Handler for EchoGetBundleRules hook.
 
static onLocalUserCreated (User $user, $autocreated)
 Handler for LocalUserCreated hook.
 
static onWikibaseHandleChange (Change $change)
 Handler for WikibaseHandleChange hook.
 

Public Attributes

const NOTIFICATION_TYPE = 'page-connection'
 Type of notification.
 

Private Member Functions

 getTitleForNotification (DiffOp $siteLinkDiffOp)
 Determines whether the change was a real sitelink addition and returns either title, or false.
 
 canNotifyForTitle (Title $title)
 Whether it's reasonable to send a notification for the title.
 

Private Attributes

 $repoLinker
 
 $namespaceChecker
 
 $redirectLookup
 
 $userOptionsManager
 
 $siteId
 
 $sendEchoNotification
 
 $repoSiteName
 

Detailed Description

Handlers for client Echo notifications.

Author
Matěj Suchánek

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\EchoNotificationsHandlers::__construct ( RepoLinker $repoLinker,
NamespaceChecker $namespaceChecker,
RedirectLookup $redirectLookup,
UserOptionsManager $userOptionsManager,
$siteId,
$sendEchoNotification,
$repoSiteName )
Parameters
RepoLinker$repoLinker
NamespaceChecker$namespaceChecker
RedirectLookup$redirectLookup
UserOptionsManager$userOptionsManager
string$siteId
bool$sendEchoNotification
string$repoSiteName

Member Function Documentation

◆ canNotifyForTitle()

Wikibase\Client\Hooks\EchoNotificationsHandlers::canNotifyForTitle ( Title $title)
private

Whether it's reasonable to send a notification for the title.

Parameters
Title$title
Returns
bool

◆ doLocalUserCreated()

Wikibase\Client\Hooks\EchoNotificationsHandlers::doLocalUserCreated ( User $user,
$autocreated )
Parameters
User$user
bool$autocreated

◆ doWikibaseHandleChange()

Wikibase\Client\Hooks\EchoNotificationsHandlers::doWikibaseHandleChange ( Change $change)
Parameters
Change$change
Returns
bool

◆ factory()

static Wikibase\Client\Hooks\EchoNotificationsHandlers::factory ( )
static

TODO: Convert this to a proper hook handler class, register factory with services in extension JSON file.

◆ getTitleForNotification()

Wikibase\Client\Hooks\EchoNotificationsHandlers::getTitleForNotification ( DiffOp $siteLinkDiffOp)
private

Determines whether the change was a real sitelink addition and returns either title, or false.

Parameters
DiffOp$siteLinkDiffOp
Returns
Title|false

◆ onEchoGetBundleRules()

static Wikibase\Client\Hooks\EchoNotificationsHandlers::onEchoGetBundleRules ( EchoEvent $event,
& $bundleString )
static

Handler for EchoGetBundleRules hook.

See also
https://www.mediawiki.org/wiki/Notifications/Developer_guide#Bundled_notifications
Parameters
EchoEvent$event
string&$bundleString

◆ onLocalUserCreated()

static Wikibase\Client\Hooks\EchoNotificationsHandlers::onLocalUserCreated ( User $user,
$autocreated )
static

Handler for LocalUserCreated hook.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/LocalUserCreated
Parameters
User$userUser object that was created.
bool$autocreatedTrue when account was auto-created

◆ onWikibaseHandleChange()

static Wikibase\Client\Hooks\EchoNotificationsHandlers::onWikibaseHandleChange ( Change $change)
static

Handler for WikibaseHandleChange hook.

See also
doWikibaseHandleChange
Parameters
Change$change

Member Data Documentation

◆ $namespaceChecker

Wikibase\Client\Hooks\EchoNotificationsHandlers::$namespaceChecker
private

◆ $redirectLookup

Wikibase\Client\Hooks\EchoNotificationsHandlers::$redirectLookup
private

◆ $repoLinker

Wikibase\Client\Hooks\EchoNotificationsHandlers::$repoLinker
private

◆ $repoSiteName

Wikibase\Client\Hooks\EchoNotificationsHandlers::$repoSiteName
private

◆ $sendEchoNotification

Wikibase\Client\Hooks\EchoNotificationsHandlers::$sendEchoNotification
private

◆ $siteId

Wikibase\Client\Hooks\EchoNotificationsHandlers::$siteId
private

◆ $userOptionsManager

Wikibase\Client\Hooks\EchoNotificationsHandlers::$userOptionsManager
private

◆ NOTIFICATION_TYPE

const Wikibase\Client\Hooks\EchoNotificationsHandlers::NOTIFICATION_TYPE = 'page-connection'

Type of notification.


The documentation for this class was generated from the following file: