summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Comments/Comment.php4
-rw-r--r--tests/lib/Comments/CommentTest.php9
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php
index acfebd32028..dd790c2e50a 100644
--- a/lib/private/Comments/Comment.php
+++ b/lib/private/Comments/Comment.php
@@ -232,10 +232,6 @@ class Comment implements IComment {
$uids = array_unique($mentions[0]);
$result = [];
foreach ($uids as $uid) {
- // exclude author, no self-mentioning
- if($uid === '@' . $this->getActorId()) {
- continue;
- }
$result[] = ['type' => 'user', 'id' => substr($uid, 1)];
}
return $result;
diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php
index 10ec4bae7d5..6f67356ccae 100644
--- a/tests/lib/Comments/CommentTest.php
+++ b/tests/lib/Comments/CommentTest.php
@@ -8,6 +8,9 @@ use Test\TestCase;
class CommentTest extends TestCase {
+ /**
+ * @throws \OCP\Comments\IllegalIDChangeException
+ */
public function testSettersValidInput() {
$comment = new Comment();
@@ -58,6 +61,9 @@ class CommentTest extends TestCase {
$comment->setId('c17');
}
+ /**
+ * @throws \OCP\Comments\IllegalIDChangeException
+ */
public function testResetId() {
$comment = new Comment();
$comment->setId('c23');
@@ -133,7 +139,7 @@ class CommentTest extends TestCase {
'@alice @bob look look, a duplication @alice test @bob!', ['alice', 'bob']
],
[
- '@alice is the author, but notify @bob!', ['bob'], 'alice'
+ '@alice is the author, notify @bob, nevertheless mention her!', ['alice', 'bob'], 'alice'
],
[
'@foobar and @barfoo you should know, @foo@bar.com is valid' .
@@ -159,7 +165,6 @@ class CommentTest extends TestCase {
$uid = array_shift($expectedUids);
$this->assertSame('user', $mention['type']);
$this->assertSame($uid, $mention['id']);
- $this->assertNotSame($author, $mention['id']);
}
$this->assertEmpty($mentions);
$this->assertEmpty($expectedUids);