Skip to content

Commit 697da4b

Browse files
Reset user status based on message ID only
Since some statuses (call) can occure with different status (away and dnd) we need to reset only based on the message id. But as it can not be set by the user this is still save and okay. Signed-off-by: Joas Schilling <[email protected]>
1 parent 339dfb8 commit 697da4b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

apps/user_status/lib/Connector/UserStatusProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ public function setUserStatus(string $userId, string $messageId, string $status,
6262
}
6363

6464
public function revertUserStatus(string $userId, string $messageId, string $status): void {
65-
$this->service->revertUserStatus($userId, $messageId, $status);
65+
$this->service->revertUserStatus($userId, $messageId);
6666
}
6767
}

apps/user_status/lib/Db/UserStatusMapper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,13 @@ public function clearMessagesOlderThan(int $timestamp): void {
172172
*
173173
* @param string $userId
174174
* @param string $messageId
175-
* @param string $status
176175
* @return bool True if an entry was deleted
177176
*/
178-
public function deleteCurrentStatusToRestoreBackup(string $userId, string $messageId, string $status): bool {
177+
public function deleteCurrentStatusToRestoreBackup(string $userId, string $messageId): bool {
179178
$qb = $this->db->getQueryBuilder();
180179
$qb->delete($this->tableName)
181180
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)))
182181
->andWhere($qb->expr()->eq('message_id', $qb->createNamedParameter($messageId)))
183-
->andWhere($qb->expr()->eq('status', $qb->createNamedParameter($status)))
184182
->andWhere($qb->expr()->eq('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)));
185183
return $qb->executeStatement() > 0;
186184
}

0 commit comments

Comments
 (0)