Merge pull request #23858 from nextcloud/backport/23842/stable20

[stable20] UserStatus: clear status message if message is null
This commit is contained in:
Morris Jobke 2020-11-03 20:41:11 +01:00 committed by GitHub
commit 28b4420797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -135,10 +135,10 @@ class UserStatusController extends OCSController {
* @throws OCSBadRequestException * @throws OCSBadRequestException
*/ */
public function setCustomMessage(?string $statusIcon, public function setCustomMessage(?string $statusIcon,
string $message, ?string $message,
?int $clearAt): DataResponse { ?int $clearAt): DataResponse {
try { try {
if ($message !== '') { if ($message !== null && $message !== '') {
$status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt); $status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt);
} else { } else {
$this->service->clearMessage($this->userId); $this->service->clearMessage($this->userId);