summaryrefslogtreecommitdiffstats
path: root/lib/Room.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-10-02 11:36:59 +0200
committerJoas Schilling <coding@schilljs.com>2022-10-02 11:36:59 +0200
commitac1cd084127f0e9d4df8bb52165a993ac6c2f95f (patch)
tree112b2e8dee3c191a95b4c3ba27d6521959d3c3d8 /lib/Room.php
parentaf347f8ef739f41e3fe4d89956c4a21964bf743d (diff)
Move resetActiveSince to service
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Room.php')
-rw-r--r--lib/Room.php21
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/Room.php b/lib/Room.php
index 032325008..a2c445b38 100644
--- a/lib/Room.php
+++ b/lib/Room.php
@@ -404,6 +404,11 @@ class Room {
return $this->activeGuests;
}
+ public function resetActiveSince(): void {
+ $this->activeGuests = 0;
+ $this->activeSince = null;
+ }
+
public function getDefaultPermissions(): int {
return $this->defaultPermissions;
}
@@ -803,20 +808,4 @@ class Room {
$this->lastMessageId = (int) $message->getId();
$this->lastActivity = $message->getCreationDateTime();
}
-
- public function resetActiveSince(): bool {
- $update = $this->db->getQueryBuilder();
- $update->update('talk_rooms')
- ->set('active_guests', $update->createNamedParameter(0, IQueryBuilder::PARAM_INT))
- ->set('active_since', $update->createNamedParameter(null, IQueryBuilder::PARAM_DATE))
- ->set('call_flag', $update->createNamedParameter(0, IQueryBuilder::PARAM_INT))
- ->set('call_permissions', $update->createNamedParameter(Attendee::PERMISSIONS_DEFAULT, IQueryBuilder::PARAM_INT))
- ->where($update->expr()->eq('id', $update->createNamedParameter($this->getId(), IQueryBuilder::PARAM_INT)))
- ->andWhere($update->expr()->isNotNull('active_since'));
-
- $this->activeGuests = 0;
- $this->activeSince = null;
-
- return (bool) $update->executeStatement();
- }
}