--- TweetANew.body.php.orig	2016-11-19 04:21:04.000000000 +0900
+++ TweetANew.body.php	2017-06-11 12:47:56.000000000 +0900
@@ -14,20 +14,38 @@
 	/**
 	 * Function for tweeting new articles
 	 *
-	 * @param $article Article
+	 * @param $wikiPage WikiPage
 	 * @param $user User
-	 * @param $summary
+	 * @param $content string
+	 * @param $summary string
+	 * @param $isMinor bool
+	 * @param $isWatch
+	 * @param $section
+	 * @param $flags
+	 * @param $revision
 	 *
 	 * @return bool
+	 *
+	 * https://www.mediawiki.org/wiki/Manual:Hooks/PageContentInsertComplete
 	 */
-	public static function TweetANewNewArticle( $article, $user, $summary ) {
+	public static function TweetANewNewArticle(
+		&$wikiPage,
+		&$user,
+		$content,
+		$summary,
+		$isMinor,
+		$isWatch,
+		$section,
+		&$flags,
+		$revision
+	 ) {
 		global $wgTweetANewTweet, $wgTweetANewText, $wgRequest;
 
 		# Check if $wgTweetANewTweet['New'] is enabled or the Tweet checkbox was selected on the edit page
 		if ( $wgRequest->getCheck( 'wpTweetANew' ) || $wgTweetANewTweet['New'] ) {
 
 			# Check if page is in content namespace or if the Tweet checkbox was selected on the edit page
-			if ( !MWNamespace::isContent( $article->getTitle()->getNamespace() )
+			if ( !MWNamespace::isContent( $wikiPage->getTitle()->getNamespace() )
 				&& !$wgRequest->getCheck( 'wpTweetANew' )
 			) {
 				return true;
@@ -35,7 +53,7 @@
 
 			# Generate final url
 			$finalurl = self::makeFinalUrl(
-				$article->getTitle()->getFullURL()
+				$wikiPage->getTitle()->getFullURL()
 			);
 
 			# Generate $author based on $wgTweetANewText['RealName']
@@ -52,13 +70,13 @@
 				# Parse random text
 				$tweet_text = wfMessage(
 					'tweetanew-new' . $switcher,
-					array( $article->getTitle()->getText(), $finalurl )
+					array( $wikiPage->getTitle()->getText(), $finalurl )
 				)->text();
 			} else {
 				# Use default tweet message format
 				$tweet_body = wfMessage(
 					'tweetanew-newdefault',
-					array( $article->getTitle()->getText(), $finalurl )
+					array( $wikiPage->getTitle()->getText(), $finalurl )
 				)->text();
 				$tweet_text = $tweet_body;
 			}
@@ -75,7 +93,7 @@
 
 			# Call to function for assembling and trimming tweet (if necessary) - then connecting and sending tweet to Twitter
 			self::makeSendTweet(
-				$article,
+				$wikiPage,
 				$tweet_text,
 				$finalurl
 			);
@@ -90,26 +108,28 @@
 	 *
 	 * @param $article Article
 	 * @param $user User
-	 * @param $text string
+	 * @param $content string
 	 * @param $summary string
-	 * @param $minoredit bool
-	 * @param $watchthis
-	 * @param $sectionanchor
+	 * @param $isMinor bool
+	 * @param $isWatch
+	 * @param $section
 	 * @param $flags
 	 * @param $revision
 	 * @param $status
 	 * @param $baseRevId
 	 *
 	 * @return bool
+	 *
+	 * https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
 	 */
 	public static function TweetANewEditMade(
 		&$article,
 		&$user,
-		$text,
+		$content,
 		$summary,
-		$minoredit,
-		$watchthis,
-		$sectionanchor,
+		$isMinor,
+		$isWatch,
+		$section,
 		&$flags,
 		$revision,
 		&$status,
@@ -124,7 +144,7 @@
 			#   and if a minor edit, checks $wgTweetANewTweet['SkipMinor']
 			# Also prevents new articles from processing as TweetANewNewArticle function is used instead
 			if ( ( !MWNamespace::isContent( $article->getTitle()->getNamespace() )
-					|| ( $minoredit !== 0 && $wgTweetANewTweet['SkipMinor'] )
+					|| ( $isMinor !== 0 && $wgTweetANewTweet['SkipMinor'] )
 					&& !$wgRequest->getCheck( 'wpTweetANewEdit' ) )
 				|| $article->getTitle()->estimateRevisionCount() == 1
 			) {
@@ -180,10 +200,10 @@
 
 			$tweet_text = '';
 			# Add prefix indication that edit is minor if enabled by $wgTweetANewText['Minor']
-			if ( $minoredit !== 0 && $wgTweetANewText['Minor'] ) {
-				$tweet_text = $article->getContext()->msg( 'tweetanew-minoredit' )->text();
+			if ( $isMinor !== 0 && $wgTweetANewText['Minor'] ) {
+				$tweet_text = wfMessage( 'tweetanew-minoredit' )->text();
 				# Add a space after the indicator if $wgTweetANewText['MinorSpace'] is true
-				if ( $minoredit !== 0 && $wgTweetANewText['MinorSpace'] ) {
+				if ( $isMinor !== 0 && $wgTweetANewText['MinorSpace'] ) {
 					$tweet_text .= ' ';
 				}
 			}
@@ -193,13 +213,13 @@
 				# Setup switcher using max number set by $wgTweetANewText['EditRandomMax']
 				$switcher = rand( 1, $wgTweetANewText['EditRandomMax'] );
 				# Parse random text
-				$tweet_text .= $article->getContext()->msg(
+				$tweet_text .= wfMessage(
 					'tweetanew-edit' . $switcher,
 					array( $article->getTitle()->getText(), $finalurl )
 				)->text();
 			} else {
 				# Use default tweet message format
-				$tweet_body = $article->getContext()->msg(
+				$tweet_body = wfMessage(
 					'tweetanew-editdefault',
 					array( $article->getTitle()->getText(), $finalurl )
 				)->text();
@@ -208,7 +228,7 @@
 
 			# Add author info if $wgTweetANewText['EditAuthor'] is true
 			if ( $wgTweetANewText['EditAuthor'] ) {
-				$tweet_text .= ' ' . $article->getContext()->msg( 'tweetanew-authorcredit' )->text() . ' ' . $author;
+				$tweet_text .= ' ' . wfMessage( 'tweetanew-authorcredit' )->text() . ' ' . $author;
 			}
 
 			# Add summary if $wgTweetANewText['EditSummary'] is true and summary text is entered
