diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-04-26 12:46:25 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-10-05 14:21:22 +0200 |
commit | b8cf2fb58b7114cf20e73554c9c73908a1e8a6a9 (patch) | |
tree | 6e944f777874983400d1f3a4515cb39a528db7ed /apps | |
parent | 66ae43880b7d898e54a47d3a4651684d85a1e951 (diff) | |
download | nextcloud-server-b8cf2fb58b7114cf20e73554c9c73908a1e8a6a9.tar.gz nextcloud-server-b8cf2fb58b7114cf20e73554c9c73908a1e8a6a9.zip |
Do not shorten comments in the activity sidebar
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/comments/lib/Activity/Extension.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/apps/comments/lib/Activity/Extension.php b/apps/comments/lib/Activity/Extension.php index 0a7503c1915..2bb9d6428e2 100644 --- a/apps/comments/lib/Activity/Extension.php +++ b/apps/comments/lib/Activity/Extension.php @@ -159,7 +159,7 @@ class Extension implements IExtension { } return (string) $l->t('%1$s commented', $params); case self::ADD_COMMENT_MESSAGE: - return $this->convertParameterToComment($params[0], 120); + return $this->convertParameterToComment($params[0]); } return false; @@ -300,21 +300,12 @@ class Extension implements IExtension { * @param string $parameter * @return string */ - protected function convertParameterToComment($parameter, $maxLength = 0) { + protected function convertParameterToComment($parameter) { if (preg_match('/^\<parameter\>(\d*)\<\/parameter\>$/', $parameter, $matches)) { try { $comment = $this->commentsManager->get((int) $matches[1]); $message = $comment->getMessage(); $message = str_replace("\n", '<br />', str_replace(['<', '>'], ['<', '>'], $message)); - - if ($maxLength && isset($message[$maxLength + 20])) { - $findSpace = strpos($message, ' ', $maxLength); - if ($findSpace !== false && $findSpace < $maxLength + 20) { - return substr($message, 0, $findSpace) . '…'; - } - return substr($message, 0, $maxLength + 20) . '…'; - } - return $message; } catch (NotFoundException $e) { return ''; |