add: Send notifications instead of chat announce for posts at staff area

This commit is contained in:
shlandturtle
2020-03-05 07:12:40 +00:00
parent 1b09be33e2
commit e3c6976aaf
7 changed files with 95 additions and 9 deletions
+10 -5
View File
@@ -146,12 +146,17 @@ class PostController extends Controller
$postUrl = sprintf('%s/forums/topics/%s?page=%s#post-%s', $appurl, $topic->id, $post->getPageNumber(), $post->id);
$realUrl = sprintf('/forums/topics/%s?page=%s#post-%s', $topic->id, $post->getPageNumber(), $post->id);
$profileUrl = sprintf('%s/users/%s', $appurl, $user->username);
$this->chat->systemMessage(sprintf('[url=%s]%s[/url] has left a reply on topic [url=%s]%s[/url]', $profileUrl, $user->username, $postUrl, $topic->name));
// Notify All Subscribers Of New Reply
if ($topic->first_user_poster_id != $user->id) {
$topic->notifyStarter($user, $topic, $post);
if (config('other.staff-forum-notify') && ($forum->id == config('other.staff-forum-id') || $forum->parent_id == config('other.staff-forum-id'))) {
$topic->notifyStaffers($user, $topic, $post);
} else {
$this->chat->systemMessage(sprintf('[url=%s]%s[/url] has left a reply on topic [url=%s]%s[/url]', $profileUrl, $user->username, $postUrl, $topic->name));
// Notify All Subscribers Of New Reply
if ($topic->first_user_poster_id != $user->id) {
$topic->notifyStarter($user, $topic, $post);
}
$topic->notifySubscribers($user, $topic, $post);
}
$topic->notifySubscribers($user, $topic, $post);
//Achievements
$user->unlock(new UserMadeFirstPost(), 1);
$user->addProgress(new UserMade25Posts(), 1);