This cleans up the command parser a lot, as all of the one or two line
functions and associated imports have been removed. Unfortunately it
does make the command files larger, as two trait impls are required:
one for converting to Box<dyn Command>, and one for converting from
&str to the command type.
Fixes#66.
- Adds a user_state table, currently only with active_room.
- A user must have an account to take advantage of state.
- Now, all users will get an 'account' even if they don't explicitly register.
- Bonus: converts user queries to compile-time checked macros.
To support these automatically created "accounts," the accounts table
now also has an account_status column, indicating if the user is
registered or not (or pending activation--future use).
The User model has been updated with extra properties from the state,
and the user is now carrried in the Context during command execution.
A user is ensured to be created before executing the command.
Instead of relying on all parts of the application to construct both
HTML and plain-text responses, we now construct only HTML responses,
and convert the HTML to plain text right before sending the message to
Matrix.
This is a first iteration, because the plain text has a few extra
newlines than it should, created by use of nested <p> tags.
This upgrade introduces a handful of breaking changes in the Rust
Matrix SDK.
- Some types have disappeared and changed name.
- Some functions are no longer async.
- Room display name now has a Result type instead of just returning
the value.
- Client state store has breaking changes (not really a big deal).
This required introduction of a new type to store room information
that we are interested in on the context struct. This new RoomContext
is required mostly due to unit tests, because it is no longer possible
to instantiate the Room type in the Matrix SDK.