MediaWiki master
MediaWiki\User\TalkPageNotificationManager Class Reference

Manages user talk page notifications. More...

Public Member Functions

 __construct (ServiceOptions $serviceOptions, IConnectionProvider $dbProvider, ReadOnlyMode $readOnlyMode, RevisionLookup $revisionLookup, HookContainer $hookContainer, UserFactory $userFactory)
 
 clearForPageView (UserIdentity $user, RevisionRecord $oldRev=null)
 Clear notifications when the user's own talk page is viewed.
 
 clearInstanceCache (UserIdentity $user)
 Remove the cached newtalk status for the given user.
 
 getLatestSeenMessageTimestamp (UserIdentity $user)
 Returns the timestamp of the latest revision of the user talkpage that the user has already seen in TS_MW format.
 
 removeUserHasNewMessages (UserIdentity $user)
 Remove the new messages status.
 
 setUserHasNewMessages (UserIdentity $user, RevisionRecord $curRev=null)
 Update the talk page messages status.
 
 userHasNewMessages (UserIdentity $user)
 Check if the user has new messages.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Manages user talk page notifications.

Since
1.35

Definition at line 39 of file TalkPageNotificationManager.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\TalkPageNotificationManager::__construct ( ServiceOptions $serviceOptions,
IConnectionProvider $dbProvider,
ReadOnlyMode $readOnlyMode,
RevisionLookup $revisionLookup,
HookContainer $hookContainer,
UserFactory $userFactory )
Parameters
ServiceOptions$serviceOptions
IConnectionProvider$dbProvider
ReadOnlyMode$readOnlyMode
RevisionLookup$revisionLookup
HookContainer$hookContainer
UserFactory$userFactory

Definition at line 64 of file TalkPageNotificationManager.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\MainConfigNames\DisableAnonTalk, and MediaWiki\Config\ServiceOptions\get().

Member Function Documentation

◆ clearForPageView()

MediaWiki\User\TalkPageNotificationManager::clearForPageView ( UserIdentity $user,
RevisionRecord $oldRev = null )

Clear notifications when the user's own talk page is viewed.

Parameters
UserIdentity$user
RevisionRecord | null$oldRevIf it is an old revision view, the old revision. If it is a current revision view, this should be null.

Definition at line 109 of file TalkPageNotificationManager.php.

References getCacheKey(), and MediaWiki\User\UserIdentity\getId().

◆ clearInstanceCache()

MediaWiki\User\TalkPageNotificationManager::clearInstanceCache ( UserIdentity $user)

Remove the cached newtalk status for the given user.

Access: internal
There should be no need to call this other than from User::clearInstanceCache
Parameters
UserIdentity$user

Definition at line 234 of file TalkPageNotificationManager.php.

◆ getLatestSeenMessageTimestamp()

MediaWiki\User\TalkPageNotificationManager::getLatestSeenMessageTimestamp ( UserIdentity $user)

Returns the timestamp of the latest revision of the user talkpage that the user has already seen in TS_MW format.

If the user has no new messages, returns null

Parameters
UserIdentity$user
Returns
string|null

Definition at line 204 of file TalkPageNotificationManager.php.

◆ removeUserHasNewMessages()

MediaWiki\User\TalkPageNotificationManager::removeUserHasNewMessages ( UserIdentity $user)

Remove the new messages status.

Parameters
UserIdentity$user

Definition at line 185 of file TalkPageNotificationManager.php.

◆ setUserHasNewMessages()

MediaWiki\User\TalkPageNotificationManager::setUserHasNewMessages ( UserIdentity $user,
RevisionRecord $curRev = null )

Update the talk page messages status.

Parameters
UserIdentity$user
RevisionRecord | null$curRevNew, as yet unseen revision of the user talk page. Null is acceptable in case the revision is not known. This will indicate that new messages exist, but will not affect the latest seen message timestamp

Definition at line 167 of file TalkPageNotificationManager.php.

◆ userHasNewMessages()

MediaWiki\User\TalkPageNotificationManager::userHasNewMessages ( UserIdentity $user)

Check if the user has new messages.

Parameters
UserIdentity$user
Returns
bool whether the user has new messages

Definition at line 86 of file TalkPageNotificationManager.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\User\TalkPageNotificationManager::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const DisableAnonTalk
Name constant for the DisableAnonTalk setting, for use with Config::get()
Access: internal
For use by ServiceWiring

Definition at line 44 of file TalkPageNotificationManager.php.


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