| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\User\Hook; |
| 4 | |
| 5 | use MediaWiki\User\UserIdentity; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "UserClearNewTalkNotification" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface UserClearNewTalkNotificationHook { |
| 15 | /** |
| 16 | * This hook is called post-send when viewing a user talk page. |
| 17 | * |
| 18 | * The hook may be aborted, in which case the TalkPageNotificationManager service |
| 19 | * will _not_ clear the "You have new messages!" notification, and if the page |
| 20 | * is on the viewer's watchlist then WatchlistManager will also _not_ update the |
| 21 | * "seen" marker. |
| 22 | * |
| 23 | * @see \MediaWiki\Watchlist\WatchlistManager::clearTitleUserNotifications |
| 24 | * @since 1.35 |
| 25 | * @param UserIdentity $userIdentity User that will clear the message |
| 26 | * @param int $oldid Revision ID of the talk page being viewed (0 means the most recent one) |
| 27 | * @return bool|void True or no return value to continue or false to abort |
| 28 | */ |
| 29 | public function onUserClearNewTalkNotification( $userIdentity, $oldid ); |
| 30 | } |