mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 16:52:46 +08:00
Database changes (#18)
* Update core references * Update core attribute names
This commit is contained in:
parent
63ff4b7fc7
commit
3e09c2bf33
|
@ -15,6 +15,6 @@ export default class NewPostNotification extends Notification {
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
return Migration::addColumns('users_discussions', [
|
||||
return Migration::addColumns('discussion_user', [
|
||||
'subscription' => ['enum', 'allowed' => ['follow', 'ignore'], 'nullable' => true]
|
||||
]);
|
||||
|
|
|
@ -32,7 +32,7 @@ class SubscriptionGambit extends AbstractRegexGambit
|
|||
$method = $negate ? 'whereNotExists' : 'whereExists';
|
||||
$search->getQuery()->$method(function ($query) use ($actor, $matches) {
|
||||
$query->selectRaw('1')
|
||||
->from('users_discussions')
|
||||
->from('discussion_user')
|
||||
->whereColumn('discussions.id', 'discussion_id')
|
||||
->where('user_id', $actor->id)
|
||||
->where('subscription', $matches[1] === 'follow' ? 'follow' : 'ignore');
|
||||
|
|
|
@ -45,7 +45,7 @@ class FilterDiscussionListBySubscription
|
|||
$actor = $event->search->getActor();
|
||||
$event->search->getQuery()->whereNotExists(function ($query) use ($actor) {
|
||||
$query->selectRaw(1)
|
||||
->from('users_discussions')
|
||||
->from('discussion_user')
|
||||
->whereColumn('discussions.id', 'discussion_id')
|
||||
->where('user_id', $actor->id)
|
||||
->where('subscription', 'ignore');
|
||||
|
|
|
@ -68,8 +68,8 @@ class SendNotificationWhenReplyIsPosted
|
|||
|
||||
$notify = $discussion->readers()
|
||||
->where('users.id', '!=', $post->user_id)
|
||||
->where('users_discussions.subscription', 'follow')
|
||||
->where('users_discussions.read_number', $discussion->last_post_number - 1)
|
||||
->where('discussion_user.subscription', 'follow')
|
||||
->where('discussion_user.last_read_post_number', $discussion->last_post_number - 1)
|
||||
->get();
|
||||
|
||||
$this->notifications->sync(
|
||||
|
|
|
@ -42,7 +42,7 @@ class NewPostBlueprint implements BlueprintInterface, MailableInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSender()
|
||||
public function getFromUser()
|
||||
{
|
||||
return $this->post->user;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user