Compare commits

..

2 Commits

Author SHA1 Message Date
Jayden Bailey c193c24be2 better checks for file namespace 2019-01-22 16:22:26 +00:00
Jayden Bailey 4b46212f49 stop substitution for edit summaries 2019-01-22 16:02:28 +00:00
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"[https://github.com/jaydenkieran Jayden Bailey]"
],
"url": "https://github.com/jaydenkieran/mw-discord",
"version": "1.0.2",
"version": "1.0.3",
"descriptionmsg": "discord-desc",
"license-name": "MIT",
"manifest_version": 1,
+3 -3
View File
@@ -32,15 +32,15 @@ class DiscordHooks {
return true;
}
if ( $wikiPage->getTitle()->inNamespace( NS_FILE ) ) {
// Don't continue, it's a file which onUploadComplete will handle instead
if ( $wikiPage->getTitle()->inNamespace( NS_FILE ) && is_null( $revision->getPrevious() ) ) {
// Don't continue, it's a new file which onUploadComplete will handle instead
return true;
}
$msg = wfMessage( 'discord-edit', DiscordUtils::createUserLinks( $user ),
DiscordUtils::createMarkdownLink( $wikiPage->getTitle(), $wikiPage->getTitle()->getFullUrl( '', '', $proto = PROTO_HTTP ) ),
DiscordUtils::createRevisionText( $revision ),
( $summary ? ('`' . DiscordUtils::truncateText( $summary ) . '`' ) : '' ) )->text();
( $summary ? ('`' . DiscordUtils::truncateText( $summary ) . '`' ) : '' ) )->plain();
DiscordUtils::handleDiscord($msg);
return true;
}