mirror of
https://github.com/flarum/framework.git
synced 2025-02-17 12:12:52 +08:00
Database changes (#16)
* Update core references * Update core attribute names
This commit is contained in:
parent
021752296d
commit
58224c2980
|
@ -12,6 +12,6 @@ export default class DiscussionLockedNotification extends Notification {
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
return app.translator.trans('flarum-lock.forum.notifications.discussion_locked_text', {user: this.props.notification.sender()});
|
return app.translator.trans('flarum-lock.forum.notifications.discussion_locked_text', {user: this.props.notification.fromUser()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,10 +96,10 @@ class CreatePostWhenDiscussionIsLocked
|
||||||
|
|
||||||
$post = $discussion->mergePost($post);
|
$post = $discussion->mergePost($post);
|
||||||
|
|
||||||
if ($discussion->start_user_id !== $user->id) {
|
if ($discussion->user_id !== $user->id) {
|
||||||
$notification = new DiscussionLockedBlueprint($post);
|
$notification = new DiscussionLockedBlueprint($post);
|
||||||
|
|
||||||
$this->notifications->sync($notification, $post->exists ? [$discussion->startUser] : []);
|
$this->notifications->sync($notification, $post->exists ? [$discussion->user] : []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class DiscussionLockedBlueprint implements BlueprintInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getSender()
|
public function getFromUser()
|
||||||
{
|
{
|
||||||
return $this->post->user;
|
return $this->post->user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class DiscussionLockedPost extends AbstractEventPost implements MergeableInterfa
|
||||||
$post = new static;
|
$post = new static;
|
||||||
|
|
||||||
$post->content = static::buildContent($isLocked);
|
$post->content = static::buildContent($isLocked);
|
||||||
$post->time = time();
|
$post->created_at = time();
|
||||||
$post->discussion_id = $discussionId;
|
$post->discussion_id = $discussionId;
|
||||||
$post->user_id = $userId;
|
$post->user_id = $userId;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user