Commit Graph

75 Commits

Author SHA1 Message Date
Dome de559f9111 feat: add room_id placeholder to join notifications
- Enhanced the join notification logic to support the {room_id} placeholder.
- This allows administrators to include direct matrix.to deep links in notification messages.
- Added a safety fallback that uses the room ID as the name if the room has no display name set.
2026-04-09 09:44:10 +02:00
Dome e33e8f0e02 Update bot.py 2026-04-09 09:23:12 +02:00
Dome 7373b9a856 fix: correct sleep logic in kick_users loop
- Fixed a bug where a string literal "sleep" was passed to the delay function.
- Switched from blocking time.sleep() to non-blocking await asyncio.sleep() to ensure the bot remains responsive during large purge operations.
- The delay now correctly pulls the numerical value from self.config["sleep"].
2026-04-09 09:08:51 +02:00
Dome 5a1ed5aa1a Update bot.py
fix: resolve room aliases in setpower and filter unjoined space rooms

This commit addresses two issues that caused API errors during room iteration and power level syncing:

1. Filter unjoined rooms in `get_space_roomlist`:
Previously, the bot assumed it was a member of all child rooms returned by the parent space state. If the bot was missing from certain child rooms, it threw errors during subsequent operations. The room list is now intersected with `await self.client.get_joined_rooms()` to safely ignore rooms the bot hasn't actually joined yet. Logging has been added to indicate when rooms are skipped.

2. Fix alias resolution (Sigil Bug) in `room_setpower`:
The `room_setpower <target_room>` command failed when users provided a standard room alias (starting with `#`) instead of an internal room ID (`!`), as the Matrix API expects the internal ID for state event operations. Added logic to detect aliases and explicitly resolve them to their respective `room_id` via `self.client.resolve_room_alias()` before attempting to update power levels. Appropriate error handling was also added to notify the user if the alias cannot be resolved.
2026-04-09 09:01:06 +02:00
William Kray 1ec4523fc1 fix room list fetch when attempting to cascade permissions. fixes #20. 2026-04-06 10:27:34 -07:00
William Kray 774c1e67ed use uncensor_pl and fix some report generation logic thresholds 2026-02-24 21:47:58 -08:00
William Kray 8b88d43c35 move verify command to room subcommand 2025-09-09 21:36:49 -07:00
William Kray a92759c100 formatting 2025-09-09 21:21:51 -07:00
William Kray 5f42420619 consolidate commands 2025-09-09 16:51:34 -07:00
William Kray 7b2a60d773 fix reporting 2025-09-09 16:20:43 -07:00
William Kray 87e02b7ea6 more refactoring 2025-09-09 14:49:45 -07:00
William Kray 6582112dfb fix some room permission nonsense 2025-09-09 11:53:50 -07:00
William Kray 63299d33aa vibe coding a lot of this because i dont have a ton of time, replacing a space doesnt work still but i think some v12 things are working so far 2025-08-22 13:22:57 -07:00
William Kray e48f2e3344 make some stuff work 2025-08-18 14:32:29 -07:00
William Kray 3d4578a8d7 fix line breaks in doctor reports 2025-06-29 22:24:07 -07:00
William Kray 81828b9b72 better doctor commands 2025-06-29 22:14:10 -07:00
William Kray e71cf4504f split diagnotic report into multiple messages if too large 2025-06-29 17:23:59 -07:00
William Kray 55771cba70 avoid bot inviting itself 2025-06-29 17:09:42 -07:00
William Kray 5510a9c634 merge slug-suffix and doctor command branches 2025-06-29 16:02:57 -07:00
William Kray fad13d1238 first attempt at diagnostic report command 2025-06-29 15:59:05 -07:00
William Kray 9237e46c6d include more opinionated creation of waitingroom settings 2025-06-29 13:10:10 -07:00
William Kray 07c8a77686 first pass at slug logic to prevent community collision 2025-06-29 11:59:01 -07:00
William Kray f4e4440122 second pass at fixing psql compat while maintaining sqlite functionality 2025-06-29 10:14:54 -07:00
David Kowis 8637603210 Change the state verification save to be a 2 step process
The insert or update logic would not work with postgresql. The new
implementation is database agnostic, so long as the response is still
the same on sqllite
2025-06-28 22:38:55 -05:00
William Kray d6076b8d2f include --unencrypted flag for room creation 2025-06-19 14:40:23 -07:00
William Kray 9c5570f58c better error handling of banlist checks on room join 2025-06-17 15:53:56 -07:00
William Kray 2430baf4cd commands to initialize a community from scratch, with sane default base-config to allow this action 2025-06-17 14:24:15 -07:00
William Kray 510ef36067 add commands to only list inactive, purgable, and ignored users for less output 2025-06-16 22:32:44 -07:00
William Kray af52108346 add better handling around get_space_roomlist 2025-04-21 08:26:07 -07:00
William Kray 28198e87c5 add some retry logic to the verification initialization 2025-04-19 10:43:09 -07:00
William Kray 481f3fbaaf oops pull ff merge 2025-04-19 09:12:06 -07:00
William Kray b22d760994 avoid verifying someone if they left the room 2025-04-19 09:10:09 -07:00
William Kray 4c11bc5702 setpower now skips verification-enabled rooms unless specifically targeted. updates to the readme. 2025-04-11 15:55:37 -07:00
William Kray afcab3b173 setpower only updates user PL in each room instead of full PL state event 2025-04-11 08:17:31 -07:00
William Kray 283400e31a fix create_room pulling bad power level values from spaces 2025-04-10 22:43:01 -07:00
William Kray 39ad02b906 move verification state management to database table to survive restarts 2025-04-10 13:52:52 -07:00
William Kray dc83711efc more cleanup of messages, and customizability for verification message! 2025-04-10 09:45:35 -07:00
William Kray a9bf6be4a6 add some state cleanup logic when someone leaves a room with verification enabled 2025-04-09 15:30:20 -07:00
William Kray 78e604c542 debug logging, better comments, notification of failed verification, etc. 2025-04-09 13:12:57 -07:00
William Kray b467a58655 update room-ids in config on replacement, better banlist error handling 2025-04-08 10:29:48 -07:00
William Kray e108e9c1c5 fix overwriting other permissions 2025-04-06 22:49:45 -07:00
William Kray 5b973920ec initial verification check dm logic 2025-04-06 21:07:01 -07:00
William Kray f0e1030534 more cleanup 2025-04-04 13:42:06 -07:00
William Kray 2cd234a7ee cleanup 2025-04-04 13:31:14 -07:00
William Kray 84a1b3157b improve room creation logic 2025-04-04 12:52:43 -07:00
William Kray 5e757df650 Merge branch 'feature/smart-pl-syncing' into develop 2025-04-04 10:31:30 -07:00
William Kray 6d0b178840 better powerlevel handling, first pass 2025-04-04 10:24:43 -07:00
William Kray 3ed2c1c4c0 new feature: archive or replace existing rooms
good for shutting off temporary rooms and keeping your space tidy, and
migrating to new rooms that the bot has appropriate permissions for.
probably doesn't solve every problem but should make it a little easier
to fix permission issues and such.
2025-04-02 15:37:08 -07:00
William Kray 034446f28c Include redaction logic:
- redact command to remove messages from a user in a room
- option to redact messages from a user in all space rooms when banned
2025-03-31 15:25:00 -07:00
William Kray 9631172334 add configurable welcome sleep timer 2024-10-19 16:48:37 -07:00