MediaWiki REL1_35
|
WatchlistNotificationManager service. More...
Public Member Functions | |
__construct (ServiceOptions $options, HookContainer $hookContainer, PermissionManager $permissionManager, ReadOnlyMode $readOnlyMode, RevisionLookup $revisionLookup, TalkPageNotificationManager $talkPageNotificationManager, WatchedItemStoreInterface $watchedItemStore) | |
clearAllUserNotifications (UserIdentity $user) | |
Resets all of the given user's page-change notification timestamps. | |
clearTitleUserNotifications (UserIdentity $user, LinkTarget $title, int $oldid=0) | |
Clear the user's notification timestamp for the given title. | |
getTitleNotificationTimestamp (UserIdentity $user, LinkTarget $title) | |
Get the timestamp when this page was updated since the user last saw it. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Attributes | |
HookRunner | $hookRunner |
array | $notificationTimestampCache = [] |
Cache for getTitleNotificationTimestamp. | |
ServiceOptions | $options |
PermissionManager | $permissionManager |
ReadOnlyMode | $readOnlyMode |
RevisionLookup | $revisionLookup |
TalkPageNotificationManager | $talkPageNotificationManager |
WatchedItemStoreInterface | $watchedItemStore |
WatchlistNotificationManager service.
Definition at line 40 of file WatchlistNotificationManager.php.
MediaWiki\User\WatchlistNotificationManager::__construct | ( | ServiceOptions | $options, |
HookContainer | $hookContainer, | ||
PermissionManager | $permissionManager, | ||
ReadOnlyMode | $readOnlyMode, | ||
RevisionLookup | $revisionLookup, | ||
TalkPageNotificationManager | $talkPageNotificationManager, | ||
WatchedItemStoreInterface | $watchedItemStore | ||
) |
ServiceOptions | $options | |
HookContainer | $hookContainer | |
PermissionManager | $permissionManager | |
ReadOnlyMode | $readOnlyMode | |
RevisionLookup | $revisionLookup | |
TalkPageNotificationManager | $talkPageNotificationManager | |
WatchedItemStoreInterface | $watchedItemStore |
Definition at line 95 of file WatchlistNotificationManager.php.
References MediaWiki\User\WatchlistNotificationManager\$options, MediaWiki\User\WatchlistNotificationManager\$permissionManager, MediaWiki\User\WatchlistNotificationManager\$readOnlyMode, MediaWiki\User\WatchlistNotificationManager\$revisionLookup, MediaWiki\User\WatchlistNotificationManager\$talkPageNotificationManager, MediaWiki\User\WatchlistNotificationManager\$watchedItemStore, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\User\WatchlistNotificationManager::clearAllUserNotifications | ( | UserIdentity | $user | ) |
Resets all of the given user's page-change notification timestamps.
If e-notif e-mails are on, they will receive notification mails on the next change of any watched page.
UserIdentity | $user |
Definition at line 123 of file WatchlistNotificationManager.php.
References MediaWiki\User\UserIdentity\getId().
MediaWiki\User\WatchlistNotificationManager::clearTitleUserNotifications | ( | UserIdentity | $user, |
LinkTarget | $title, | ||
int | $oldid = 0 |
||
) |
Clear the user's notification timestamp for the given title.
If e-notif e-mails are on, they will receive notification mails on the next change of the page if it's watched etc.
UserIdentity | $user | |
LinkTarget | $title | |
int | $oldid | The revision id being viewed. If not given or 0, latest revision is assumed. |
Definition at line 163 of file WatchlistNotificationManager.php.
References MediaWiki\User\WatchlistNotificationManager\$revisionLookup, MediaWiki\User\WatchlistNotificationManager\$talkPageNotificationManager, $title, MediaWiki\User\UserIdentity\getName(), MediaWiki\Revision\RevisionLookup\getNextRevision(), MediaWiki\Revision\RevisionLookup\getRevisionById(), MediaWiki\User\UserIdentity\isRegistered(), NS_USER_TALK, MediaWiki\User\TalkPageNotificationManager\removeUserHasNewMessages(), MediaWiki\User\TalkPageNotificationManager\setUserHasNewMessages(), and MediaWiki\User\TalkPageNotificationManager\userHasNewMessages().
MediaWiki\User\WatchlistNotificationManager::getTitleNotificationTimestamp | ( | UserIdentity | $user, |
LinkTarget | $title | ||
) |
Get the timestamp when this page was updated since the user last saw it.
UserIdentity | $user | |
LinkTarget | $title |
Definition at line 254 of file WatchlistNotificationManager.php.
References $title, and MediaWiki\User\UserIdentity\getId().
|
private |
Definition at line 51 of file WatchlistNotificationManager.php.
|
private |
Cache for getTitleNotificationTimestamp.
Keys need to reflect both the specific user and the title:
Since only users have watchlists, the user is represented with u⧼user id⧽
Since the method accepts LinkTarget objects, cannot rely on the object's toString, since it is different for TitleValue and Title. Implement a simplified string representation of the string that TitleValue uses: ⧼namespace number⧽:⧼db key⧽
Entries are in the form of u⧼user id⧽-⧼namespace number⧽:⧼db key⧽ => ⧼timestamp or false⧽
Definition at line 84 of file WatchlistNotificationManager.php.
|
private |
Definition at line 48 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct().
|
private |
Definition at line 54 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct().
|
private |
Definition at line 57 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct().
|
private |
Definition at line 60 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct(), and MediaWiki\User\WatchlistNotificationManager\clearTitleUserNotifications().
|
private |
Definition at line 63 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct(), and MediaWiki\User\WatchlistNotificationManager\clearTitleUserNotifications().
|
private |
Definition at line 66 of file WatchlistNotificationManager.php.
Referenced by MediaWiki\User\WatchlistNotificationManager\__construct().
const MediaWiki\User\WatchlistNotificationManager::CONSTRUCTOR_OPTIONS |
Definition at line 42 of file WatchlistNotificationManager.php.