Commit Graph

74 Commits

Author SHA1 Message Date
Sean 0b897052ee
Merge pull request #20 from darcys22/room-id-type
Replaces room_id variables with typed versions
2021-09-14 12:07:14 +10:00
Sean Darcy 1523699dd1 Replaces room_id variables with typed versions
Allows for better protection of the input strings and fits into type
checking.
2021-09-14 11:49:33 +10:00
Jason Rhinelander dd02092519 Reformat 2021-09-13 11:48:01 +10:00
Jason Rhinelander f242a82738 Remove table-names-in-global-variables antipattern
These make the code more complex and make the the queries harder to
read.

Tables in global variables is an antipattern that stemmed from old PHP
(or similar) web hosts that came with a single MySQL table requiring you
use different prefixes to load multiple instances in the same table.
Without mysql or prefix configurability it's an antipattern that just
results in less readable code.
2021-09-13 11:48:01 +10:00
Maxim Shishmarev e6b9b8d42f Delete all expired files in parallel 2021-08-18 16:40:41 +10:00
Maxim Shishmarev fa7c375595 Make file deletion async; use in-memory database in tests 2021-08-18 16:40:41 +10:00
Niels Andriesse 57101a68fc Add migration 2021-06-11 10:05:00 +10:00
Niels Andriesse c56268365e Fix multi device auth token handling 2021-06-11 09:47:34 +10:00
nielsandriesse faed07bf7d Minor cleanup 2021-06-04 15:42:10 +10:00
Niels Andriesse a14659ea46
Merge pull request #32 from majestrate/user-activity-stats-2021-05-28
Active User Stats Endpoint
2021-06-04 15:24:06 +10:00
nielsandriesse 8dd65e32dc Make the formatter happy 2021-06-03 11:07:52 +10:00
nielsandriesse 13167da344 Fix broken SQL query 2021-06-03 10:36:55 +10:00
nielsandriesse d2c81f2af7 Add logging 2021-06-03 09:54:09 +10:00
nielsandriesse 3c97465783 Add logging 2021-06-03 09:40:50 +10:00
Jeff Becker d73e2cbb48
add active session stats
* make a table for user activity so we can calculate the number of active sessions
* every time a public key fetches messages mark it as an active session
* expose an api endpoint to fetch the number of active sessions from now to a given number of seconds ago
* make sure user tables are updated when we run migrations
* give posts posted in the last time slice along with active users
2021-06-02 07:48:48 -04:00
nielsandriesse bc328fff4c Lower file expiration threshold 2021-06-01 13:31:25 +10:00
Maxim Shishmarev fd43521b0b Fix a bunch of lint warnings 2021-05-14 14:22:33 +10:00
Niels Andriesse b0c2b6d4d5 Remove temporary migration 2021-04-29 11:43:09 +10:00
Niels Andriesse 3d5dbfe981 Add migration 2021-04-29 11:24:31 +10:00
Niels Andriesse 51b75100b8 Fix id re-use issue 2021-04-29 11:18:05 +10:00
nielsandriesse e87d240025 Make logs more descriptive 2021-04-28 12:08:38 +10:00
nielsandriesse 79a648494d Don't use nanos 2021-04-28 11:56:28 +10:00
nielsandriesse 7fcaa80cce Fix SQL usage & include deletion ID in JSON response 2021-04-28 09:50:03 +10:00
Niels Andriesse cb67709ba5 Debug 2021-04-28 08:43:04 +10:00
Niels Andriesse 1bbc521893 Store files by room 2021-04-27 15:51:53 +10:00
Niels Andriesse de16e74d53 Fix incorrect ID handling 2021-04-27 11:42:00 +10:00
Niels Andriesse 5b0ad2f253 Fix file pruning 2021-04-09 13:07:18 +10:00
Niels Andriesse 57ea49e30e Use appropriate log levels 2021-04-01 09:55:47 +11:00
nielsandriesse acc81729ef Fix remaining misleading async usage 2021-03-31 15:12:32 +11:00
Niels Andriesse 9d6c7f8566 Use integer IDs for files 2021-03-26 15:24:02 +11:00
Niels Andriesse 0872281b78 Include message timestamp 2021-03-26 10:21:08 +11:00
Niels Andriesse 42e2e0df41 Add get room info endpoint 2021-03-25 13:56:26 +11:00
Niels Andriesse f9ffd8c463 Don't use nightly 2021-03-25 11:38:06 +11:00
Niels Andriesse edca4b9e95 Add .rustfmt.toml 2021-03-25 10:56:16 +11:00
Niels Andriesse 75994e792c Add missing is_empty() check 2021-03-23 15:43:57 +11:00
Niels Andriesse 786f7293d5 Fix room ID vs room name usage 2021-03-23 15:39:42 +11:00
Niels Andriesse ddba1f6396 Minor refactoring 2021-03-23 14:25:52 +11:00
Niels Andriesse 2b662dfcc7 Fix build 2021-03-23 13:45:17 +11:00
Niels Andriesse a6dfce3129 Hopefully fix path issue on Ubuntu 2021-03-23 13:43:33 +11:00
Niels Andriesse b36a80dcc2 Fix room ID type 2021-03-23 13:21:28 +11:00
Niels Andriesse 4c4a23f8b5 Match client changes 2021-03-22 13:25:14 +11:00
Niels Andriesse 9c1bd0242c Fix database interaction 2021-03-19 13:26:53 +11:00
Niels Andriesse 07114fad8b WIP 2021-03-19 11:52:18 +11:00
Niels Andriesse 955192f5fe Add file storage & retrieval tests 2021-03-19 11:18:03 +11:00
Niels Andriesse 8df05a9129 Implement file storage & retrieval 2021-03-19 10:09:13 +11:00
Niels Andriesse eb6c372fc7 Fix build 2021-03-18 15:56:01 +11:00
Niels Andriesse 304df4e125 Get room from RPC call 2021-03-18 15:53:24 +11:00
Niels Andriesse 803087ead3 Update pruning for rooms 2021-03-18 15:35:18 +11:00
Niels Andriesse 2e24270092 Update database layout for rooms 2021-03-18 15:24:47 +11:00
Niels Andriesse 1e93f9472e Prepare for rooms implementation 2021-03-18 15:04:56 +11:00