]> source.dussan.org Git - nextcloud-server.git/commitdiff
Group sharing activities by user/group and file respectively
authorJoas Schilling <nickvergessen@owncloud.com>
Fri, 20 Mar 2015 08:49:33 +0000 (09:49 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Fri, 20 Mar 2015 08:49:33 +0000 (09:49 +0100)
apps/files_sharing/lib/activity.php

index 0cd874d69f024e5e9673cab0baf99ab0189a00cf..50ec2f297d718e012daf6e2fa3f53eb30f06bd77 100644 (file)
@@ -202,6 +202,7 @@ class Activity implements IExtension {
                } else if ($app === 'files') {
                        switch ($text) {
                                case self::SUBJECT_SHARED_LINK_SELF:
+                                       return [0 => 'file'];
                                case self::SUBJECT_SHARED_USER_SELF:
                                case self::SUBJECT_SHARED_WITH_BY:
                                        return [0 => 'file', 1 => 'username'];
@@ -225,6 +226,19 @@ class Activity implements IExtension {
         * @return integer|false
         */
        public function getGroupParameter($activity) {
+               if ($activity['app'] === 'files') {
+                       switch ($activity['subject']) {
+                               case self::SUBJECT_SHARED_LINK_SELF:
+                               case self::SUBJECT_SHARED_WITH_BY:
+                                       // Group by file name
+                                       return 0;
+                               case self::SUBJECT_SHARED_USER_SELF:
+                               case self::SUBJECT_SHARED_GROUP_SELF:
+                                       // Group by user/group
+                                       return 1;
+                       }
+               }
+
                return false;
        }