diff options
Diffstat (limited to 'lib/private/Group/Group.php')
-rw-r--r-- | lib/private/Group/Group.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index a50a5ffde78..8d86425c8e5 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -33,6 +33,7 @@ namespace OC\Group; use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\IHideFromCollaborationBackend; use OC\Hooks\PublicEmitter; +use OCP\Group\Backend\ISetDisplayNameBackend; use OCP\GroupInterface; use OCP\IGroup; use OCP\IUser; @@ -101,6 +102,20 @@ class Group implements IGroup { return $this->displayName; } + public function setDisplayName(string $displayName): bool { + $displayName = trim($displayName); + if ($displayName !== '') { + foreach ($this->backends as $backend) { + if (($backend instanceof ISetDisplayNameBackend) + && $backend->setDisplayName($this->gid, $displayName)) { + $this->displayName = $displayName; + return true; + } + } + } + return false; + } + /** * get all users in the group * |