Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/user_status/lib/Connector/UserStatusProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public function setUserStatus(string $userId, string $messageId, string $status,
}

public function revertUserStatus(string $userId, string $messageId, string $status): void {
$this->service->revertUserStatus($userId, $messageId, $status);
$this->service->revertUserStatus($userId, $messageId);
}
}
4 changes: 1 addition & 3 deletions apps/user_status/lib/Db/UserStatusMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,13 @@ public function clearMessagesOlderThan(int $timestamp): void {
*
* @param string $userId
* @param string $messageId
* @param string $status
* @return bool True if an entry was deleted
*/
public function deleteCurrentStatusToRestoreBackup(string $userId, string $messageId, string $status): bool {
public function deleteCurrentStatusToRestoreBackup(string $userId, string $messageId): bool {
$qb = $this->db->getQueryBuilder();
$qb->delete($this->tableName)
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)))
->andWhere($qb->expr()->eq('message_id', $qb->createNamedParameter($messageId)))
->andWhere($qb->expr()->eq('status', $qb->createNamedParameter($status)))
->andWhere($qb->expr()->eq('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)));
return $qb->executeStatement() > 0;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/user_status/lib/Service/StatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public function backupCurrentStatus(string $userId): bool {
}
}

public function revertUserStatus(string $userId, ?string $messageId, string $status): void {
public function revertUserStatus(string $userId, ?string $messageId): void {
try {
/** @var UserStatus $userStatus */
$backupUserStatus = $this->mapper->findByUserId($userId, true);
Expand All @@ -513,7 +513,7 @@ public function revertUserStatus(string $userId, ?string $messageId, string $sta
return;
}

$deleted = $this->mapper->deleteCurrentStatusToRestoreBackup($userId, $messageId ?? '', $status);
$deleted = $this->mapper->deleteCurrentStatusToRestoreBackup($userId, $messageId ?? '');
if (!$deleted) {
// Another status is set automatically or no status, do nothing
return;
Expand Down