Commit Graph

38 Commits

Author SHA1 Message Date
Nikita Vilunov 3476f2e367 update dependencies 2024-06-18 14:26:39 +02:00
Nikita Vilunov 59528909c7 core: ADT for results of room history queries 2024-06-05 02:04:11 +02:00
Nikita Vilunov f3cd794431 core: do not ignore errors on sending to channels 2024-06-05 00:43:39 +02:00
Nikita Vilunov 2c828b482e core: ADT for results of room joins 2024-06-05 00:10:36 +02:00
Nikita Vilunov 4e8eb09184 reduce usage of unwraps (#70)
Reviewed-on: lavina/lavina#70
2024-06-04 21:54:57 +00:00
Nikita Vilunov d0420ec834 core: use members instead of subscribers in RoomInfo 2024-06-03 13:06:41 +02:00
Mikhail bb0b911e5e irc: basic `chathistory` capability support without `batch` markers (#73)
Reviewed-on: lavina/lavina#73
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-06-01 11:34:53 +00:00
Nikita Vilunov 43d105ab23 core: subscribe to rooms on player actor startup 2024-05-26 18:56:28 +02:00
Mikhail 381b5650bc xmpp, core: Send message history on MUC join (#68)
Re-send the entire message history on MUC join. Contributes to #5.

Reviewed-on: lavina/lavina#68
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-05-26 11:20:26 +00:00
Nikita Vilunov 26720a2a08 core: separate the model from the logic implementation (#66)
This separates the core in two layers – the model objects and the `LavinaCore` service. Service is responsible for implementing the application logic and exposing it as core's public API to projections, while the model objects will be independent of each other and responsible only for managing and owning in-memory data.

The model objects include:
1. `Storage` – the open connection to the SQLite DB.
2. `PlayerRegistry` – creates, stores refs to, and stops player actors.
3. `RoomRegistry` – manages active rooms.
4. `DialogRegistry` – manages active dialogs.
5. `Broadcasting` – manages subscriptions of players to rooms on remote cluster nodes.
6. `LavinaClient` – manages HTTP connections to remote cluster nodes.
7. `ClusterMetadata` – read-only configuration of the cluster metadata, i.e. allocation of entities to nodes.

As a result:
1. Model objects will be fully independent of each other, e.g. it's no longer necessary to provide a `Storage` to all registries, or to provide `PlayerRegistry` and `DialogRegistry` to each other.
2. Model objects will no longer be `Arc`-wrapped; instead the whole `Services` object will be `Arc`ed and provided to projections.
3. The public API of `lavina-core` will be properly delimited by the APIs of `LavinaCore`, `PlayerConnection` and so on.
4. `LavinaCore` and `PlayerConnection` will also contain APIs of all features, unlike it was previously with `RoomRegistry` and `DialogRegistry`. This is unfortunate, but it could be improved in future.

Reviewed-on: lavina/lavina#66
2024-05-13 14:32:45 +00:00
Nikita Vilunov d1a72e7978 move repo methods into submodules and clean up warnings 2024-05-10 23:50:34 +02:00
Nikita Vilunov 6749103726 scalability: initial support for remote rooms (#61)
Reviewed-on: lavina/lavina#61
2024-05-10 20:44:24 +00:00
Mikhail 3b454ad7cd xmpp: unit-tests for resource bind it and muc presence
Reviewed-on: lavina/lavina#64
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-05-10 13:35:34 +00:00
Mikhail 5512a74999 Check if user is a member before inserting a membership (#62)
It would typically fail on insertion due to uniqueness constraints: user id - room id.

Reviewed-on: lavina/lavina#62
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-05-08 22:10:32 +00:00
Nikita Vilunov bb0fe3bf0b use borrows in http endpoint handlers 2024-05-05 19:24:42 +02:00
Nikita Vilunov 8ac64ba8f5 get rid of storage usages in projections 2024-05-05 19:24:23 +02:00
homycdev abe9a26925 irc: implement WHOIS command (#43)
Reviewed-on: lavina/lavina#43
Co-authored-by: homycdev <abdulkhamid98@gmail.com>
Co-committed-by: homycdev <abdulkhamid98@gmail.com>
2024-05-05 17:21:40 +00:00
Nikita Vilunov 9a09ff717e management api endpoints for rooms 2024-05-01 17:30:31 +02:00
Nikita Vilunov 25605322a0 player shutdown API (#58)
Reviewed-on: lavina/lavina#58
2024-04-29 17:24:43 +00:00
Nikita Vilunov ea81ddadfc dialog message persistence 2024-04-27 12:58:27 +02:00
Nikita Vilunov 4ff09ea05f tracing otlp exporter and instrumentation annotations (#57)
Resolves #56

Reviewed-on: lavina/lavina#57
2024-04-26 10:16:23 +00:00
Nikita Vilunov ec49489ef1 validate that rooms and dialogs are owned exclusively on shutdown 2024-04-23 19:18:46 +02:00
Nikita Vilunov d305f5bf77 argon2-based password hashing (#55)
Reviewed-on: lavina/lavina#55
2024-04-23 16:31:00 +00:00
Nikita Vilunov 799da8366c basic dialog implementation with irc and xmpp support (#53)
Reviewed-on: lavina/lavina#53
2024-04-23 16:26:40 +00:00
Nikita Vilunov d805061d5b refactor auth logic into a common module (#54)
Reviewed-on: lavina/lavina#54
2024-04-23 10:10:10 +00:00
Nikita Vilunov 12d30ca5c2 irc: implement server-time capability for incoming messages (#52)
Spec: https://ircv3.net/specs/extensions/server-time
Reviewed-on: lavina/lavina#52
2024-04-21 21:00:44 +00:00
Nikita Vilunov ddb348bee9 refactor lavina core by grouping public services into a new LavinaCore struct.
this will be useful in future when additional services will be introduced and passed as dependencies
2024-04-21 19:45:50 +02:00
Nikita Vilunov 5a09b743c9 return AlreadyJoined when a player attempts to join a room they are already in 2024-04-20 17:09:44 +02:00
Nikita Vilunov cebe354179 update libraries 2024-04-19 14:27:19 +02:00
Nikita Vilunov 757d7c5665 persistent room topics (#50)
Reviewed-on: lavina/lavina#50
2024-04-15 09:12:23 +00:00
Nikita Vilunov 0105a5b710 persistent memberships (#49)
Reviewed-on: lavina/lavina#49
2024-04-15 09:06:10 +00:00
Mikhail fd694cd75c Add message timestamps (#41)
Resolves #38

Reviewed-on: lavina/lavina#41
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-04-12 21:32:21 +00:00
Nikita Vilunov d436631450 improve docs and split command handlers into methods (#40) 2024-03-26 16:26:31 +00:00
Nikita Vilunov 878ec33cbb apply uniform formatting 2024-03-20 19:59:15 +01:00
Nikita Vilunov 0b98102580 add author id in messages schema 2023-10-04 18:32:08 +02:00
Nikita Vilunov 4621470bde fix graceful shutdown 2023-10-02 23:35:23 +02:00
Nikita Vilunov 854a244dbc split irc proejction into a separate crate (#18) 2023-09-30 23:34:35 +00:00
Nikita Vilunov a1db17c779 split core into a separate crate (#17) 2023-09-30 23:12:11 +00:00