mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 15:53:36 -04:00
Merge pull request #22165 from owncloud/comments-markowncommentasread
Mark own comments as read after posting
This commit is contained in:
commit
079ebe2be6
2 changed files with 9 additions and 0 deletions
|
|
@ -116,6 +116,11 @@ class CommentsPlugin extends ServerPlugin {
|
|||
$data,
|
||||
$request->getHeader('Content-Type')
|
||||
);
|
||||
|
||||
// update read marker for the current user/poster to avoid
|
||||
// having their own comments marked as unread
|
||||
$node->setReadMarker(null);
|
||||
|
||||
$url = $request->getUrl() . '/' . urlencode($comment->getId());
|
||||
|
||||
$response->setHeader('Content-Location', $url);
|
||||
|
|
|
|||
|
|
@ -92,6 +92,10 @@ class CommentsPlugin extends \Test\TestCase {
|
|||
->method('getId')
|
||||
->will($this->returnValue('42'));
|
||||
|
||||
$node->expects($this->once())
|
||||
->method('setReadMarker')
|
||||
->with(null);
|
||||
|
||||
$this->commentsManager->expects($this->once())
|
||||
->method('create')
|
||||
->with('users', 'alice', 'files', '42')
|
||||
|
|
|
|||
Loading…
Reference in a new issue