mirror of
https://github.com/flarum/core.git
synced 2025-08-09 09:57:06 +02:00
Database changes (#18)
* Update core references * Update core attribute names
This commit is contained in:
committed by
Franz Liedke
parent
63ff4b7fc7
commit
3e09c2bf33
@@ -15,6 +15,6 @@ export default class NewPostNotification extends Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {user: this.props.notification.sender()});
|
return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {user: this.props.notification.fromUser()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,6 @@
|
|||||||
|
|
||||||
use Flarum\Database\Migration;
|
use Flarum\Database\Migration;
|
||||||
|
|
||||||
return Migration::addColumns('users_discussions', [
|
return Migration::addColumns('discussion_user', [
|
||||||
'subscription' => ['enum', 'allowed' => ['follow', 'ignore'], 'nullable' => true]
|
'subscription' => ['enum', 'allowed' => ['follow', 'ignore'], 'nullable' => true]
|
||||||
]);
|
]);
|
||||||
|
@@ -32,7 +32,7 @@ class SubscriptionGambit extends AbstractRegexGambit
|
|||||||
$method = $negate ? 'whereNotExists' : 'whereExists';
|
$method = $negate ? 'whereNotExists' : 'whereExists';
|
||||||
$search->getQuery()->$method(function ($query) use ($actor, $matches) {
|
$search->getQuery()->$method(function ($query) use ($actor, $matches) {
|
||||||
$query->selectRaw('1')
|
$query->selectRaw('1')
|
||||||
->from('users_discussions')
|
->from('discussion_user')
|
||||||
->whereColumn('discussions.id', 'discussion_id')
|
->whereColumn('discussions.id', 'discussion_id')
|
||||||
->where('user_id', $actor->id)
|
->where('user_id', $actor->id)
|
||||||
->where('subscription', $matches[1] === 'follow' ? 'follow' : 'ignore');
|
->where('subscription', $matches[1] === 'follow' ? 'follow' : 'ignore');
|
||||||
|
@@ -45,7 +45,7 @@ class FilterDiscussionListBySubscription
|
|||||||
$actor = $event->search->getActor();
|
$actor = $event->search->getActor();
|
||||||
$event->search->getQuery()->whereNotExists(function ($query) use ($actor) {
|
$event->search->getQuery()->whereNotExists(function ($query) use ($actor) {
|
||||||
$query->selectRaw(1)
|
$query->selectRaw(1)
|
||||||
->from('users_discussions')
|
->from('discussion_user')
|
||||||
->whereColumn('discussions.id', 'discussion_id')
|
->whereColumn('discussions.id', 'discussion_id')
|
||||||
->where('user_id', $actor->id)
|
->where('user_id', $actor->id)
|
||||||
->where('subscription', 'ignore');
|
->where('subscription', 'ignore');
|
||||||
|
@@ -68,8 +68,8 @@ class SendNotificationWhenReplyIsPosted
|
|||||||
|
|
||||||
$notify = $discussion->readers()
|
$notify = $discussion->readers()
|
||||||
->where('users.id', '!=', $post->user_id)
|
->where('users.id', '!=', $post->user_id)
|
||||||
->where('users_discussions.subscription', 'follow')
|
->where('discussion_user.subscription', 'follow')
|
||||||
->where('users_discussions.read_number', $discussion->last_post_number - 1)
|
->where('discussion_user.last_read_post_number', $discussion->last_post_number - 1)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$this->notifications->sync(
|
$this->notifications->sync(
|
||||||
|
@@ -42,7 +42,7 @@ class NewPostBlueprint implements BlueprintInterface, MailableInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getSender()
|
public function getFromUser()
|
||||||
{
|
{
|
||||||
return $this->post->user;
|
return $this->post->user;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user