summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-25 15:18:54 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-30 15:14:31 +0200
commit4c9c73bef925d41d8bc9f39f4365c34d794ab86a (patch)
tree504e77e4cb47b2d9eb760c4538920382a8d8ed3e
parent4f0abd910cae4e122ca8db2a9e6f588ac8df039a (diff)
downloadnextcloud-server-4c9c73bef925d41d8bc9f39f4365c34d794ab86a.tar.gz
nextcloud-server-4c9c73bef925d41d8bc9f39f4365c34d794ab86a.zip
Correct the app name for sharing events
-rw-r--r--apps/files_sharing/lib/activity.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php
index 68953f950c8..a21f57235c9 100644
--- a/apps/files_sharing/lib/activity.php
+++ b/apps/files_sharing/lib/activity.php
@@ -28,6 +28,7 @@ use OCP\Activity\IExtension;
use OCP\IURLGenerator;
class Activity implements IExtension {
+ const FILES_SHARING_APP = 'files_sharing';
/**
* Filter with all sharing related activities
*/
@@ -72,7 +73,7 @@ class Activity implements IExtension {
}
protected function getL10N($languageCode = null) {
- return $this->languageFactory->get('files_sharing', $languageCode);
+ return $this->languageFactory->get(self::FILES_SHARING_APP, $languageCode);
}
/**
@@ -146,7 +147,7 @@ class Activity implements IExtension {
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
$l = $this->getL10N($languageCode);
- if ($app === 'files_sharing') {
+ if ($app === self::FILES_SHARING_APP) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
return (string) $l->t('You received a new remote share from %s', $params);
@@ -160,9 +161,6 @@ class Activity implements IExtension {
return (string) $l->t('Public shared folder %1$s was downloaded', $params);
case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED:
return (string) $l->t('Public shared file %1$s was downloaded', $params);
- }
- } else if ($app === 'files') {
- switch ($text) {
case self::SUBJECT_SHARED_USER_SELF:
return (string) $l->t('You shared %1$s with %2$s', $params);
case self::SUBJECT_SHARED_GROUP_SELF:
@@ -189,7 +187,7 @@ class Activity implements IExtension {
* @return array|false
*/
public function getSpecialParameterList($app, $text) {
- if ($app === 'files_sharing') {
+ if ($app === self::FILES_SHARING_APP) {
switch ($text) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED:
return array(
@@ -207,9 +205,6 @@ class Activity implements IExtension {
return array(
0 => 'file',
);
- }
- } else if ($app === 'files') {
- switch ($text) {
case self::SUBJECT_SHARED_LINK_SELF:
return [0 => 'file'];
case self::SUBJECT_SHARED_USER_SELF:
@@ -273,7 +268,7 @@ class Activity implements IExtension {
}
/**
- * The extension can check if a customer filter (given by a query string like filter=abc) is valid or not.
+ * The extension can check if a custom filter (given by a query string like filter=abc) is valid or not.
*
* @param string $filterValue
* @return boolean
@@ -310,8 +305,8 @@ class Activity implements IExtension {
public function getQueryForFilter($filter) {
if ($filter === self::FILTER_SHARES) {
return [
- '(`app` = ? or `app` = ?)',
- ['files_sharing', 'files'],
+ '`app` = ?',
+ [self::FILES_SHARING_APP,],
];
}
return false;