diff --git a/apps/dav/lib/comments/commentsplugin.php b/apps/dav/lib/comments/commentsplugin.php index 282c14df1e..56d94cc33e 100644 --- a/apps/dav/lib/comments/commentsplugin.php +++ b/apps/dav/lib/comments/commentsplugin.php @@ -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); diff --git a/apps/dav/tests/unit/comments/commentsplugin.php b/apps/dav/tests/unit/comments/commentsplugin.php index bd0b56fc65..9822137bbe 100644 --- a/apps/dav/tests/unit/comments/commentsplugin.php +++ b/apps/dav/tests/unit/comments/commentsplugin.php @@ -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')