Skip to content
Snippets Groups Projects
Unverified Commit 3308c409 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #14967 from nextcloud/lib-private-user-trigger-pass-old

Do not issue update command if nothing has changed in user values
parents ccabc63a c1e6a596
No related branches found
No related tags found
No related merge requests found
......@@ -138,11 +138,12 @@ class User implements IUser {
*/
public function setDisplayName($displayName) {
$displayName = trim($displayName);
if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName)) {
$oldDisplayName = $this->getDisplayName();
if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName) && $displayName !== $oldDisplayName) {
$result = $this->backend->setDisplayName($this->uid, $displayName);
if ($result) {
$this->displayName = $displayName;
$this->triggerChange('displayName', $displayName);
$this->triggerChange('displayName', $displayName, $oldDisplayName);
}
return $result !== false;
}
......
......@@ -164,6 +164,7 @@ class Dummy extends Backend implements \OCP\IUserBackend {
public function setDisplayName($uid, $displayName) {
$this->displayNames[$uid] = $displayName;
return true;
}
public function getDisplayName($uid) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment