diff --git a/framework/core/CHANGELOG.md b/framework/core/CHANGELOG.md index b2b86b731..a9bc34df4 100644 --- a/framework/core/CHANGELOG.md +++ b/framework/core/CHANGELOG.md @@ -24,6 +24,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Output forum description in meta description tag. ([#506](https://github.com/flarum/core/issues/506)) +- Allow users to edit their last post in a discussion even if it's hidden. +- Allow users to rename their discussion even if their first post is hidden. - Fix several design bugs. ## [0.1.0-beta.2] - 2015-09-15 diff --git a/framework/core/src/Core/Discussions/DiscussionsServiceProvider.php b/framework/core/src/Core/Discussions/DiscussionsServiceProvider.php index 273aa0ae5..8e7edcdb4 100644 --- a/framework/core/src/Core/Discussions/DiscussionsServiceProvider.php +++ b/framework/core/src/Core/Discussions/DiscussionsServiceProvider.php @@ -48,7 +48,7 @@ class DiscussionsServiceProvider extends ServiceProvider $allowRenaming = $settings->get('allow_renaming'); if ($allowRenaming === '-1' || - ($allowRenaming === 'reply' && $event->model->participants_count == 1) || + ($allowRenaming === 'reply' && $event->model->participants_count <= 1) || ($event->model->start_time->diffInMinutes(Carbon::now()) < $allowRenaming)) { return true; } diff --git a/framework/core/src/Core/Posts/PostsServiceProvider.php b/framework/core/src/Core/Posts/PostsServiceProvider.php index 1b18706aa..f048d366a 100644 --- a/framework/core/src/Core/Posts/PostsServiceProvider.php +++ b/framework/core/src/Core/Posts/PostsServiceProvider.php @@ -55,11 +55,12 @@ class PostsServiceProvider extends ServiceProvider if ($post->discussion->can($actor, 'editPosts')) { return true; } + if ($post->user_id == $actor->id && (! $post->hide_time || $post->hide_user_id == $actor->id)) { $allowEditing = $settings->get('allow_post_editing'); if ($allowEditing === '-1' || - ($allowEditing === 'reply' && $event->model->number == $event->model->discussion->last_post_number) || + ($allowEditing === 'reply' && $event->model->number >= $event->model->discussion->last_post_number) || ($event->model->time->diffInMinutes(Carbon::now()) < $allowEditing)) { return true; }