mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(ban): Remove unused methods
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
9eb9aa2caa
commit
2a9f0c0db1
3 changed files with 0 additions and 45 deletions
|
|
@ -111,19 +111,4 @@ class BanController extends AEnvironmentAwareController {
|
|||
$this->banService->findAndDeleteBanByIdForRoom($banId, $this->room->getId());
|
||||
return new DataResponse([], Http::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return TalkBan
|
||||
*/
|
||||
protected function randomBan(string $actorType, string $actorId): array {
|
||||
return [
|
||||
'id' => random_int(1, 1337),
|
||||
'actorType' => $this->participant->getAttendee()->getActorType(),
|
||||
'actorId' => $this->participant->getAttendee()->getActorId(),
|
||||
'bannedType' => $actorType,
|
||||
'bannedId' => $actorId,
|
||||
'bannedTime' => random_int(1514747958, 1714747958),
|
||||
'internalNote' => '#NOTE#' . $actorType . '#' . $actorId . '#' . sha1($actorType . $actorId),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,15 +61,4 @@ class BanMapper extends QBMapper {
|
|||
|
||||
return $this->findEntity($query);
|
||||
}
|
||||
|
||||
public function deleteBanForActorAndRoom(string $actorId, string $actorType, int $roomId): void {
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->delete($this->getTableName())
|
||||
->where($query->expr()->eq('actor_id', $query->createNamedParameter($actorId, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($query->expr()->eq('actor_type', $query->createNamedParameter($actorType, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($query->expr()->eq('room_id', $query->createNamedParameter($roomId, IQueryBuilder::PARAM_INT)));
|
||||
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,25 +53,6 @@ class BanService {
|
|||
return $this->banMapper->findForActorAndRoom($actorId, $actorType, $roomId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ban for a specific actor and room.
|
||||
*/
|
||||
public function deleteBanForActorAndRoom(string $actorId, string $actorType, int $roomId): void {
|
||||
$this->banMapper->deleteBanForActorAndRoom($actorId, $actorType, $roomId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find and delete a ban for a specific actor and room.
|
||||
*/
|
||||
public function findAndDeleteBanForActorAndRoom(string $actorId, string $actorType, int $roomId): void {
|
||||
try {
|
||||
$ban = $this->getBanForActorAndRoom($actorId, $actorType, $roomId);
|
||||
$this->deleteBanForActorAndRoom($actorId, $actorType, $roomId);
|
||||
} catch (DoesNotExistException $e) {
|
||||
// Ban does not exist
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all bans for a specific room.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue