* feat: implement time based message sweep on user ban
- Adds `delete_message_seconds` (0 to 7 days in seconds) to the ban request payload.
Signed-off-by: arsabutispik <ispik@ispik.dev>
* refactor: pass ulid conversion to database
Signed-off-by: arsabutispik <ispik@ispik.dev>
* fix: use COL constant instead of hardcoded string in error mapper
Signed-off-by: arsabutispik <ispik@ispik.dev>
* refactor: broadcast bulk delete events during ban sweep
Updates the `delete_messages_by_author_since` trait to return a
HashMap of deleted message IDs grouped by channel.
The MongoDB implementation now uses a two-step process: it first
runs a projected `find` query to gather the target `_id` and
`channel` fields, then executes the `delete_many` operation.
This allows the ban route to loop through the affected channels and
dispatch `EventV1::BulkMessageDelete` WebSocket events, ensuring
that the swept messages are instantly removed from the UI for
all connected clients.
Signed-off-by: arsabutispik <ispik@ispik.dev>
* refactor: optimize message deletion by using $group and aggregate
Signed-off-by: arsabutispik <ispik@ispik.dev>
* refactor: use with_type in query
Signed-off-by: arsabutispik <ispik@ispik.dev>
* refactor: abstract function to Message model and mark attachments as deleted
Signed-off-by: arsabutispik <ispik@ispik.dev>
---------
Signed-off-by: arsabutispik <ispik@ispik.dev>