- Rename `in_chat_requests` table to `incoming_chat`
- Send chat requests and responses when the user is online
- Remove `IncomingChatExt::remove_in_chat_request` trait function
- Rename `in_on` col of `incoming_chat` table to `received_timestamp`
- Add `accepted_response` col to `incoming_chat` table
- Rename `UserId` to `IdCol` and make it private
Reviewed-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Reviewed-on: #35
Signed-off-by: Awiteb <a@4rs.nl>
### Changes
- Implement `salvo_oapi::Extractible` and `salvo_oapi::EndpointArgRegister`
for `PublicKey`
- Implement `salvo_oapi::Extractible` and `salvo_oapi::ToParameters` for `Signature`
### Notes
I did not implement `salvo_oapi::ToParameters` for `PublicKey` because it will
not be used as an OpenAPI parameter. Instead, Salvo will register it using the
`EndpointArgRegister` trait.
Similarly, I did not implement `salvo_oapi::EndpointArgRegister` for `Signature`
because it will not be used as an argument in the endpoint. Instead, the
signature will be verified by the signature middleware, and we will only use it
as a parameter.
Reviewed-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Reviewed-on: #33
Fixes: #21
Helped-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Signed-off-by: Awiteb <a@4rs.nl>
I have removed the task spwaning in `handle_socket` function, because Salvo
already spawn `handle_socket` function in a new task when upgrading the
connection to websocket. So, there is no need to spawn a new task in
`handle_socket` function.
refs:
- Salvo task spawning: https://github.com/salvo-rs/salvo/blob/main/crates/extra/src/websocket.rs#L247-L256
Reviewed-on: #34
Reviewed-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Signed-off-by: Awiteb <a@4rs.nl>
Replace `as` with `AS`
- Remove `version` from `docker-compose.yml`
- Add database configration to oxidetalis environment
- Add `healthcheck` for the database
Signed-off-by: Awiteb <a@4rs.nl>
In this patch, I have implemented the chat request and response from OTMP
protocol. The changes include:
- New `in_chat_request` and `out_chat_request` database tables
- New `users_status` table to store user status (whitelisted or blacklisted)
- New server events:
- `ChatRequest` To send chat request comes from some user
- `ChatRequestResponse` To send chat request response to some user
- New client events:
- `ChatRequest` To send chat request to some user
- `ChatRequestResponse` To send chat request response to some user
- `ws_errors` macro to create websocket errors
- `/user/whitelist` and `/user/blacklist` API to list whitelisted and
blacklisted users
Fixes: #2
Reviewed-on: #14
Reviewed-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Helped-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Signed-off-by: Awiteb <a@4rs.nl>
Don't pass the nonce cache limit everywhere, we allocate the hashmap capacity
with it, so we can use the hashmap capacity directly.
Also refactor the `NonceCache` type, make it better without extension trait.
Suggested-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Reviewed-by: Amjad Alsharafi <me@amjad.alsharafi.dev>
Signed-off-by: Awiteb <a@4rs.nl>