Commit Graph

333 Commits

Author SHA1 Message Date
projectmoon c1ec7366e4 Add user accounts, registration command, secure command valiation. 2021-05-22 14:01:16 +00:00
projectmoon a84d4fd869 Make command parsing case insensitive. 2021-05-21 22:40:03 +00:00
projectmoon 34ee2c6e5d Consider command execution secure when proper conditions are met.
- If the room is end-to-end encrypted.
 - If only the sending user and the bot are present in the room.

This lays groundwork for sensitive commands like registering a user
account with the bot.
2021-05-21 22:28:45 +00:00
projectmoon 9de74d05a9 Add an is_secure attribute for commands. 2021-05-21 15:32:08 +00:00
projectmoon 5643677627 Consolidate dice and variable parsers under parser module. 2021-05-21 14:44:03 +00:00
projectmoon de63fd914e Move commands.rs to commands/mod.rs; move migrate_cli.rs. 2021-05-21 14:35:56 +00:00
projectmoon e73ad118b2 Move some declaration-only modules to mod.rs files in folders. 2021-05-21 14:30:46 +00:00
projectmoon 3d5cda39c8 Consolidate dice module into logic module. 2021-05-21 14:26:58 +00:00
projectmoon 402f236ba7 Remove sled and all related crates from dependencies. 2021-05-21 14:21:22 +00:00
projectmoon 059538b95d Remove remaining warnings. 2021-05-21 14:14:03 +00:00
projectmoon 4de273db4a Remove sled code; promote sql to top level 2021-05-21 14:05:25 +00:00
projectmoon a33367fada Update dependencies to fix matrix SDK list users bug. 2021-05-20 15:40:52 +00:00
projectmoon 5630b4ed20 Add sled migration utility. 2021-05-20 15:30:44 +00:00
projectmoon 6b6be06c89 Update sqlx offline json. 2021-05-19 21:36:16 +00:00
projectmoon a3b39ee42c Use ON CONFLICT and transactions where appropriate. 2021-05-19 21:34:11 +00:00
projectmoon 7eee16961e Add tests for dbstate. 2021-05-19 21:16:39 +00:00
projectmoon 43d8f9574f Allow 'upserts' in insert_room_info. Add a few more room db tests. 2021-05-19 21:06:28 +00:00
projectmoon 1c4cd3d139 Add tests for rooms db API 2021-05-18 22:15:03 +00:00
projectmoon d1c04b8817 Tests for all of the variables DB api. 2021-05-18 21:39:48 +00:00
projectmoon 5e899cd962 Return key not found error if value not found for user. 2021-05-18 15:37:20 +00:00
projectmoon 257f3a066c Some user variable tests. 2021-05-18 15:17:30 +00:00
projectmoon e539dcac1f Move migrations to sqlite directory. Remove in-memory temp db until refinery supports sqlx. 2021-05-18 14:50:49 +00:00
projectmoon 9f97a6cb43 Implement variable count; fix listing all variables returning values for all users. 2021-05-18 14:27:15 +00:00
projectmoon a665293268 Fix recording of room users, better logging.
- Fix constraint violations when recording users in rooms (migration fix).
 - Switched to tracing_subscriber to get log events from matrix SDK.
 - Remove "Applying migration" messages, and rely on refinery to log instead.
 - Log when an outgoing error is encountered.
2021-05-17 23:12:27 +00:00
projectmoon 66fb6e7cf8 Fix various issues with room events and related logic.
- Processing events multiple times when re-joining rooms.
 - Always thinking we've not processed an event/constraint
   violations (arguments were reversed in record_event).
 - Not handling errors when fetchin users in a room, and instead
   just suppressing them. Now, we handle errors!
 - Also update dependencies (attempt to fix ID too big bug, but no
   fix).
2021-05-16 22:24:27 +00:00
projectmoon bfc5609ab6 Add proper constraints to db tables. Report errors when listing users. 2021-05-16 21:39:19 +00:00
projectmoon 9798821b7b Implement room and dbstate for sqlite. 2021-05-16 14:29:57 +00:00
projectmoon cf9ce63892 Replace application-level database connectivity.
- Some database methods not yet implemented.
 - Unit tests create temp files that are not cleaned up (but they should be).
2021-05-15 23:45:30 +00:00
projectmoon 6b6e59da2e Initial SQLx implementation (variables). not yet wired up to bot.
- Adds migrations for the necessary tables.
 - Implements the user variables database functions.
 - Adds sqlx metadata for 'offline' use so we can build without a database.
2021-05-15 15:27:40 +00:00
projectmoon b1972e2850 Update dependencies. 2021-05-14 22:53:10 +00:00
projectmoon 49d4ae3037 Update names and links in readme. 2021-05-14 22:42:14 +00:00
projectmoon ffda24833e Fix build badge after rename. 2021-05-14 22:39:53 +00:00
projectmoon 9446435843 Version 0.10.0. 2021-05-14 22:27:57 +00:00
projectmoon b894fb83db Update binary entrypoint crate imports after rename. 2021-05-14 22:25:09 +00:00
projectmoon 30f800eb4a Relicense to AGPL, change project name. 2021-05-14 22:07:16 +00:00
projectmoon e553472b7a Update readme for user variables regarding Call Of Cthulhu. 2021-05-13 22:35:08 +00:00
projectmoon 2096af2512 Show username pill when executing multiple commands. 2021-05-13 22:31:38 +00:00
projectmoon 490d17790a Add a few more aliases for cthulhu advancement rolls. 2021-05-13 22:12:47 +00:00
projectmoon 38fbef4101 Update help; add call of cthulhu. 2021-05-13 21:47:35 +00:00
projectmoon 0396911c56 Remove extraneous <p> tags in dice roll outputs. 2021-05-13 21:29:44 +00:00
projectmoon c4e0393d99 Update variables on advancement rolls. 2021-05-13 21:16:41 +00:00
projectmoon d67328ac6b Cthulhu dice only take one amount now 2021-05-13 20:24:17 +00:00
projectmoon ec66bfa3d6 Add parse_single_amount 2021-05-13 20:06:37 +00:00
projectmoon 8939d6debd Update dependencies. 2021-05-13 19:48:29 +00:00
projectmoon 0f35c1932b Merge pull request 'Update to Rust 1.51' (#57) from rust-1.51 into master
Reviewed-on: projectmoon/matrix-dicebot#57
2021-04-24 19:42:31 +00:00
projectmoon 7a506bdc4f Update drone to 1.51 2021-04-20 21:39:08 +00:00
projectmoon b62359c172 Update to rust 1.51 with rustup, for zeroconf 0.4 which requires const generics. 2021-04-20 21:35:12 +00:00
projectmoon 8d1a1a5ca6 Update dependencies. 2021-04-20 21:19:47 +00:00
projectmoon 119321e01a Update dependencies. 2021-04-02 16:07:15 +00:00
projectmoon ba6a4c9679 Update matrix SDK to latest with Room enum 2.0 2021-03-22 15:01:49 +00:00