-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rooms): add option to automatically lock public and group rooms #13779
base: main
Are you sure you want to change the base?
Conversation
…if they are inactive Signed-off-by: Anna Larch <[email protected]>
/backport to stable30 |
… rooms if they are inactive
… rooms if they are inactive
Not for now |
@@ -111,3 +111,4 @@ Legend: | |||
| `conversations_files` | string<br>`1` or `0` | `1` | No | 🖌️ | Whether the files app integration is enabled allowing to start conversations in the right sidebar | | |||
| `conversations_files_public_shares` | string<br>`1` or `0` | `1` | No | 🖌️ | Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled) | | |||
| `enable_matterbridge` | string<br>`1` or `0` | `0` | No | 🖌️ | Whether the Matterbridge integration is enabled and can be configured | | |||
| `inactivity_lock_time` | int | `0` | No | | A duration (in seconds) after which rooms are locked. Calculated from the last activity in the room. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the background jobs are only run hourly (I would even change it to daily),
I would make this config "days" of inactivity
* | ||
* @return int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | |
* @return int |
Not needed when the method has ): int {
$helper->selectRoomsTable($query); | ||
$query->from('talk_rooms', 'r') | ||
->andWhere($query->expr()->lte('r.last_activity', $query->createNamedParameter($inactiveSince, IQueryBuilder::PARAM_DATETIME_MUTABLE))) | ||
->andWhere($query->expr()->lte('r.read_only', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->andWhere($query->expr()->lte('r.read_only', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) | |
->andWhere($query->expr()->neq('r.read_only', $query->createNamedParameter(Room::READ_ONLY, IQueryBuilder::PARAM_INT))) |
return; | ||
} | ||
$timestamp = $this->time->getTime() - $interval; | ||
$time = (new \DateTime())->setTimestamp($timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$time = (new \DateTime())->setTimestamp($timestamp); | |
$time = $this->time->getDateTime('@' . $timestamp); |
$time = (new \DateTime())->setTimestamp($timestamp); | ||
$rooms = $this->roomService->getInactiveRooms($time); | ||
array_map(function (Room $room) { | ||
$this->roomService->setReadOnly($room, Room::READ_ONLY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log as info (or at least debug)?
@@ -1212,4 +1212,12 @@ public function deleteRoom(Room $room): void { | |||
)); | |||
} | |||
} | |||
|
|||
/** | |||
* @param \DateTime $inactiveSince |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param \DateTime $inactiveSince |
…if they are inactive
Question - do we need to limit the room numbers to a certain amount per run of the BG job?
☑️ Resolves
🛠️ API Checklist
🚧 Tasks
🏁 Checklist
docs/
has been updated or is not required