Skip to content

Commit

Permalink
Merge pull request SimpleMachines#8181 from BrickOzp/no_notification_…
Browse files Browse the repository at this point in the history
…emails

Fix topic notifications if user subscribe to both topic and board
  • Loading branch information
Sesquipedalian committed Apr 29, 2024
2 parents 5da827a + 4277718 commit 7a757ab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/tasks/CreatePost-Notify.php
Expand Up @@ -154,6 +154,17 @@ public function execute()
unset($row['id_group'], $row['id_post_group'], $row['additional_groups']);
}

// If this user subscribes both to the topic and the board there will be two records returned.
// Copy board/topic data to the new record or it will be lost.
if (!empty($this->members['watching'][$row['id_member']])) {
if ($this->members['watching'][$row['id_member']]['id_board'] > 0) {
$row['id_board'] = $this->members['watching'][$row['id_member']]['id_board'];
}
if ($this->members['watching'][$row['id_member']]['id_topic'] > 0) {
$row['id_topic'] = $this->members['watching'][$row['id_member']]['id_topic'];
}
}

$this->members['watching'][$row['id_member']] = $row;
}
$smcFunc['db_free_result']($request);
Expand Down

0 comments on commit 7a757ab

Please sign in to comment.