Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment notifications #64

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions includes/ImportDumpRequestManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@

class ImportDumpRequestManager {

private const SYSTEM_USERS = [
private const IGNORED_USERS = [
'ImportDump Extension',
'ImportDump Status Update',
];

public const CONSTRUCTOR_OPTIONS = [
Expand Down Expand Up @@ -163,7 +162,7 @@ public function addComment( string $comment, User $user ) {

if (
ExtensionRegistry::getInstance()->isLoaded( 'Echo' ) &&
!in_array( $user->getName(), self::SYSTEM_USERS )
!in_array( $user->getName(), self::IGNORED_USERS )
) {
$this->sendNotification( $comment, 'importdump-request-comment', $user );
}
Expand Down Expand Up @@ -263,7 +262,7 @@ public function getComments(): array {
* @return array
*/
public function getInvolvedUsers(): array {
return array_unique( array_column( $this->getComments(), 'user' ) + [ $this->getRequester() ] );
return array_unique( array_merge( array_column( $this->getComments(), 'user' ), [ $this->getRequester() ] ) );
}

/**
Expand Down
Loading