summaryrefslogtreecommitdiff
blob: 78c5e49997bc9f7b0e7c25928e74f868a109b597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
 * This class formats log entries for thanks
 */
class ThanksLogFormatter extends LogFormatter {
	/**
	 * @inheritDoc
	 */
	protected function getMessageParameters() {
		$params = parent::getMessageParameters();
		// Convert target from a pageLink to a userLink since the target is
		// actually a user, not a page.
		$recipient = User::newFromName( $this->entry->getTarget()->getText(), false );
		$params[2] = Message::rawParam( $this->makeUserLink( $recipient ) );
		$params[3] = $recipient->getName();
		return $params;
	}

	public function getPreloadTitles() {
		// Add the recipient's user talk page to LinkBatch
		return [ Title::makeTitle( NS_USER_TALK, $this->entry->getTarget()->getText() ) ];
	}
}