bitfl0wer
3cd19ed15e
Remove display impl, add default trait
2023-05-07 11:32:25 +02:00
bitfl0wer
fafc864dfe
Impl user::get() function
2023-05-07 11:32:11 +02:00
bitfl0wer
df850b33d5
add test fn
2023-05-07 00:18:21 +02:00
bitfl0wer
3e6e8b7812
add users to mod.rs
2023-05-07 00:18:14 +02:00
bitfl0wer
45d5505e2c
remove nesting layer
2023-05-07 00:18:06 +02:00
bitfl0wer
70a426c754
Add users to mod.rs
2023-05-07 00:17:54 +02:00
bitfl0wer
7211ff5eb3
add pronouns
2023-05-06 22:47:31 +02:00
bitfl0wer
aa89168928
add mod.rs
2023-05-06 22:47:26 +02:00
bitfl0wer
7920dc62e6
Implement message sending (without attachments)
2023-05-06 22:24:23 +02:00
bitfl0wer
9855465fe4
change visibilities
2023-05-06 22:23:48 +02:00
bitfl0wer
4aaaee3e1e
impl SendMessageSchema
2023-05-06 22:23:34 +02:00
bitfl0wer
f943f57f03
rename user rate_limits to limits for consistency
2023-05-06 18:52:24 +02:00
bitfl0wer
0efdc8bfc2
Construct new message send method basics
2023-05-06 18:52:09 +02:00
bitfl0wer
63ece12636
change message to messagesendschema
2023-05-06 18:34:38 +02:00
kozabrada123
9f187b8864
Add a debug to heartbeat thread
2023-05-06 11:14:38 +02:00
kozabrada123
7d3077eec4
Pub mod everything so it can be used as a library
2023-05-06 11:13:07 +02:00
kozabrada123
172c000813
Update Websocket to fix premature closing w 1006
2023-05-06 10:39:58 +02:00
kozabrada123
6fdff97722
Update types to fix deserialization errors
2023-05-06 10:39:16 +02:00
kozabrada123
7dbdcf828d
Slight code cleanup
2023-05-06 08:39:41 +02:00
kozabrada123
a4fdf18106
Fixed instance lifetime parameter
2023-05-05 22:46:00 +02:00
kozabrada123
22bfe1be07
Readd gateway to instance
2023-05-05 22:04:57 +02:00
bitfl0wer
00aa998ad0
remove redundant code
2023-05-05 22:00:37 +02:00
bitfl0wer
e41563b101
start re-doing send()
2023-05-05 21:53:23 +02:00
bitfl0wer
9b5caf6392
Add DiscordFileAttachment, change visibilities
2023-05-05 21:53:00 +02:00
bitfl0wer
abd555dfac
Add MessageSendSchema
2023-05-05 21:52:27 +02:00
kozabrada123
7ac4da8482
Fix encoding wrong
2023-05-05 20:58:00 +02:00
kozabrada123
ab4c20562c
Remove the dumb test stuff I left in
2023-05-05 20:28:47 +02:00
kozabrada123
47c38c5541
Give websocket a send and receive channel
2023-05-05 20:26:51 +02:00
kozabrada123
6a99129fe7
Add temp debug, remove unused token
2023-05-05 19:42:31 +02:00
kozabrada123
f6c9d5a807
Experimental sending to gateway
2023-05-05 19:23:57 +02:00
kozabrada123
85d79bb304
Experimental heartbeats
2023-05-05 18:38:04 +02:00
kozabrada123
23472d01d9
Update integers on some types
2023-05-05 18:37:52 +02:00
kozabrada123
ec2030794d
Add gateway Ready event
2023-05-05 16:08:12 +02:00
kozabrada123
2dda6f767e
Update data for existing events
2023-05-05 15:46:45 +02:00
kozabrada123
28f3312cac
No need to serialize this
2023-05-05 15:39:11 +02:00
bitfl0wer
a706341e36
handle attachment-messages seperately
2023-05-05 14:38:37 +02:00
bitfl0wer
e4be9d49c2
change name type from String to i16
2023-05-05 14:38:22 +02:00
bitfl0wer
65480d51e6
Fix counter not being incremented
2023-05-05 14:19:38 +02:00
bitfl0wer
12c6efc72e
Change HashMap to Map
...
Filenames can be non-unique, which could not be accurately represented using a HashMap.
2023-05-05 14:18:59 +02:00
bitfl0wer
c90e8b62e8
Add new() DiscordFileAttachment
2023-05-05 14:16:09 +02:00
bitfl0wer
d1f44aace3
Rename File to DiscordFileAttachment, work on that
2023-05-04 23:00:48 +02:00
kozabrada123
0ff3a21423
Add basic event receiving
2023-05-04 20:57:45 +02:00
kozabrada123
284073deeb
Add WebSocketConnection to Gateway
2023-05-04 20:05:33 +02:00
bitfl0wer
28778f578f
Add bearer auth for message sending
2023-05-03 23:13:12 +02:00
bitfl0wer
8903f494ac
Add start of attachments implementation
2023-05-03 23:04:32 +02:00
bitfl0wer
0e9a0c4c3c
Remove unused imports
2023-05-03 21:06:01 +02:00
bitfl0wer
ef8366e1bd
fix build fail by commenting out unused stuff
2023-05-03 21:05:09 +02:00
bitfl0wer
7369bdd59f
Merge remote-tracking branch 'origin/feature/sending-messages'
2023-05-03 17:39:57 +02:00
bitfl0wer
c4b15b5bf0
change reference to be mutable
2023-05-03 17:29:32 +02:00
bitfl0wer
7560361bf5
add send_message to user
2023-05-03 17:29:20 +02:00
bitfl0wer
5d545d7fc9
Add get_as_mut to Limits
2023-05-03 17:12:32 +02:00
bitfl0wer
a0df444f87
Remove blank line
2023-05-03 17:12:23 +02:00
bitfl0wer
fc9032c038
change visibilities to pub
2023-05-03 17:11:48 +02:00
bitfl0wer
efb68a607a
cargo clippy --fix
2023-05-03 16:38:42 +02:00
bitfl0wer
5edc92524c
Add lifetime to Instance
2023-05-03 16:37:10 +02:00
bitfl0wer
6858b1eb0d
Add Message send()
2023-05-03 16:27:04 +02:00
bitfl0wer
7938addf67
Start working on message send body
2023-05-03 15:55:01 +02:00
bitfl0wer
514ae0e441
Add message.rs
2023-05-03 15:45:07 +02:00
Flori
b6789420a2
Merge pull request #25 from polyphony-chat/feature/sending-messages
...
Bring main up to date
2023-05-02 22:51:49 +02:00
bitfl0wer
18e4803089
Add messages.rs to implement messages features
2023-05-02 22:46:41 +02:00
bitfl0wer
a8e3ad0950
add GatewayPayload
2023-04-30 21:54:15 +02:00
bitfl0wer
f95212b803
add example threaded websocketconnection
2023-04-30 14:45:15 +02:00
bitfl0wer
283e3fd9ac
Get GatewayHello from Stream
2023-04-30 12:17:35 +02:00
bitfl0wer
8e6daeff84
Add TLS support to WS connection
2023-04-30 11:56:14 +02:00
bitfl0wer
9f76679a35
Add types for Heartbeat and Hello (Gateway)
2023-04-30 11:48:53 +02:00
bitfl0wer
f565cf8366
implement Gateway::new()
2023-04-28 23:21:55 +02:00
bitfl0wer
909e8d39ed
Make GatewatIdentifyPayload pub
2023-04-28 20:30:03 +02:00
bitfl0wer
be09e79bab
Working on Gateway impl
2023-04-28 20:29:40 +02:00
bitfl0wer
728ff0b551
Add Default derives to types
2023-04-28 18:18:32 +02:00
bitfl0wer
0e6d5ba901
Add documentation comments
2023-04-28 13:40:29 +02:00
bitfl0wer
f7217e877b
renamed mod to example
2023-04-28 12:39:58 +02:00
bitfl0wer
3099a0165b
Implement Observer for WebSocketEvents
2023-04-28 12:31:59 +02:00
bitfl0wer
caafb9a620
Add error type for Observers
2023-04-27 22:38:57 +02:00
bitfl0wer
0711c9beba
Indicate that method call can fail
2023-04-27 22:38:41 +02:00
bitfl0wer
bd64bbde24
Update observer implementation
2023-04-27 22:29:07 +02:00
bitfl0wer
920ed044c6
start implementing ovserver
2023-04-27 17:57:10 +02:00
bitfl0wer
2569fafbbb
add GatewayResume
2023-04-25 23:06:16 +02:00
bitfl0wer
67eb1e087d
add more types
2023-04-25 22:34:43 +02:00
bitfl0wer
bea7efd8a9
add typing start event
2023-04-25 22:08:09 +02:00
bitfl0wer
f465ad7cc3
Add more Types
2023-04-25 22:03:25 +02:00
bitfl0wer
b976eadd70
metric ton of types for message deserialization
2023-04-25 21:42:46 +02:00
bitfl0wer
0f66081b4d
Fix error due to deletion of impl::Display
2023-04-25 21:42:11 +02:00
bitfl0wer
27206e4a0f
Merge remote-tracking branch 'origin/main' into feature/gateway-observer
2023-04-25 18:00:44 +02:00
bitfl0wer
3b8891b2dd
Improve readability
2023-04-25 17:41:14 +02:00
bitfl0wer
c67c23f6b4
Improve readability
2023-04-25 17:33:35 +02:00
bitfl0wer
6f2dac6695
Split up schemas.rs
2023-04-25 17:32:30 +02:00
bitfl0wer
496305f091
Add dependencies
2023-04-25 17:21:27 +02:00
bitfl0wer
a5943197d4
separate User and Instance limits.
2023-04-24 20:58:45 +02:00
bitfl0wer
aba42a6869
Give each user their own rate limits
2023-04-24 19:51:35 +02:00
bitfl0wer
88b715ee6c
Merge remote-tracking branch 'origin/main' into improvement/update-rate-limiter-implementation
2023-04-24 19:50:36 +02:00
bitfl0wer
30742380b9
Change HashMap<> to Limits
2023-04-24 19:49:26 +02:00
bitfl0wer
21c7bdcf8b
Implement Limits::new() and more logic
2023-04-24 19:38:42 +02:00
bitfl0wer
82770c0400
Create internal User and API UserObject
2023-04-23 21:32:48 +02:00
bitfl0wer
c11ae79fe2
comment out test until spacebar pr is merged
2023-04-23 20:21:36 +02:00
bitfl0wer
fe3c582d09
Implement Login
2023-04-23 20:11:14 +02:00
bitfl0wer
242eddd5c8
make compiler happy
2023-04-23 14:01:02 +02:00
bitfl0wer
22adda7aa6
start working on login
2023-04-23 14:00:27 +02:00
bitfl0wer
48333cf854
Make send_request return Result
2023-04-23 13:58:17 +02:00
bitfl0wer
8b40b4c3b2
Made test pass
2023-04-23 13:45:52 +02:00
bitfl0wer
b374fdee7d
Add documentation
2023-04-23 12:06:51 +02:00
bitfl0wer
83ebd482e5
Made AuthEmail, Password and Username reusable
2023-04-23 11:58:45 +02:00
bitfl0wer
1bdf202745
Register function with good errors!
2023-04-22 22:12:56 +02:00
bitfl0wer
c6ded56510
push progress
2023-04-22 11:32:44 +02:00
bitfl0wer
752c885c10
Remove boilerplate errors
2023-04-21 23:20:23 +02:00
bitfl0wer
aacba2d2a2
impl register
2023-04-21 18:20:57 +02:00
bitfl0wer
d8b06921b6
add error
2023-04-21 18:20:49 +02:00
bitfl0wer
06bc2955a3
Move custom errros to central file
2023-04-21 16:18:20 +02:00
bitfl0wer
1c2a60613b
Replace Custom Error boilerplate with macro
2023-04-21 15:04:58 +02:00
bitfl0wer
92afaccf33
create errors.rs
2023-04-21 14:30:10 +02:00
bitfl0wer
dd97341886
Add TODO
2023-04-21 14:30:03 +02:00
bitfl0wer
d98316b3ee
Fix bad build
2023-04-21 14:27:56 +02:00
bitfl0wer
7aedc371cf
Have AuthRegister and AbsoluteRegister cancel each other out
2023-04-20 20:11:12 +02:00
bitfl0wer
5baed11d4e
Change comment
2023-04-20 19:47:20 +02:00
bitfl0wer
d2f3403a18
Improve limit check
2023-04-20 19:47:08 +02:00
bitfl0wer
fec52f506d
begin working on register
2023-04-20 00:14:11 +02:00
bitfl0wer
b577161733
add users hashmap
2023-04-19 23:32:02 +02:00
bitfl0wer
45b13e4865
add await to fix test error
2023-04-19 20:58:14 +02:00
bitfl0wer
e1d004afae
add additional documentation and TODO
2023-04-19 20:42:28 +02:00
bitfl0wer
db177fdaad
create new() method
2023-04-19 20:42:11 +02:00
bitfl0wer
d6bd7c4710
Include new file
2023-04-19 20:41:52 +02:00
bitfl0wer
6a8260c4bb
make progress on instance object creation
2023-04-19 20:41:33 +02:00
bitfl0wer
c5b9e0efee
implement getting InstancePoliciesSchema
...
Co-authored-by: sky <skyrina@users.noreply.github.com>
2023-04-19 20:41:15 +02:00
bitfl0wer
d4ea4bd096
remove token check, add username impl
2023-04-17 22:38:21 +02:00
bitfl0wer
f12d5ed8f6
add Token struct and impl
2023-04-17 21:31:15 +02:00
bitfl0wer
dc5cd09091
start working on register
2023-04-16 23:03:24 +02:00
bitfl0wer
3be962146b
add gateway object
2023-04-16 23:03:12 +02:00
bitfl0wer
1319ca1736
use camel case
2023-04-16 22:50:51 +02:00
bitfl0wer
fde38bc358
remove impl LoginSchema, add InstancePolicies
2023-04-16 22:18:51 +02:00
bitfl0wer
4c9ddc4569
Add PartialEq and Eq derives
2023-04-16 22:16:39 +02:00
bitfl0wer
f6fce684c1
Rename client to instance
2023-04-16 22:16:22 +02:00
bitfl0wer
7dc25dd4c6
add auth module
2023-04-16 15:07:15 +02:00
bitfl0wer
fc397672f5
reformat file
2023-04-16 14:55:13 +02:00
bitfl0wer
6cba2f93e1
Added email regex validation and tests
2023-04-16 14:09:23 +02:00
bitfl0wer
f4b500eadb
Implement LoginSchema
2023-04-16 13:41:26 +02:00
bitfl0wer
0ec8e3371b
add comment
2023-04-16 12:33:57 +02:00
bitfl0wer
98551dc2a2
Write test to check consent validation
2023-04-16 12:32:49 +02:00
bitfl0wer
b8038f52bf
write tests to check username validation
2023-04-16 12:30:30 +02:00
bitfl0wer
30610aacfd
add tests to confirm password validation
2023-04-16 12:26:12 +02:00
bitfl0wer
1b9ccf3154
add "new" method for RegSchema with custom errors
2023-04-15 22:06:18 +02:00
bitfl0wer
db45e493ec
Add TotpSchema
2023-04-15 21:20:32 +02:00
bitfl0wer
e1003ac2b6
Update RegisterSchema, add LoginSchema
2023-04-15 21:16:47 +02:00
bitfl0wer
ff60853d0b
create RegisterSchema
2023-04-15 21:12:33 +02:00
bitfl0wer
4f922e163f
create schemas.rs
2023-04-15 20:16:18 +02:00
bitfl0wer
8ac0c2994f
add test_send_request
2023-04-15 18:16:26 +02:00
bitfl0wer
6b98a2cc23
add limit updates for Error, Global, Ip
...
Despite Error, Global and Ip technically being handled seperately, we still need to update their "reset" and "limit" values to match what the API tells us.
2023-04-15 17:12:33 +02:00
bitfl0wer
2ec0d3b9c8
remove unneccessary variable
2023-04-15 17:09:42 +02:00
bitfl0wer
d30343df38
add add_remaining
...
add_remaining() adds an i64 to the interal "remaining: u64" with underflow protection.
2023-04-15 17:08:19 +02:00
bitfl0wer
62358d05db
update internal values through mut ref
2023-04-15 17:07:46 +02:00
bitfl0wer
c01adc28fa
add fallback if no rate limit header received
2023-04-15 14:55:50 +02:00
bitfl0wer
ce075524c8
Derive PartialEq and Eq to use assertEq in tests
2023-04-15 13:54:57 +02:00
bitfl0wer
b758246b12
add test which checks instance rate limits working
2023-04-15 13:54:33 +02:00
bitfl0wer
38bf6dd5d1
rename tests
2023-04-15 13:27:43 +02:00
bitfl0wer
57a1df35e6
Fix incorrect url formatting, add more tests
2023-04-15 13:27:34 +02:00
bitfl0wer
13a2b2daab
Fixed goofy ahh way to remove a slash from the end of the url
2023-04-15 13:03:51 +02:00
bitfl0wer
ead320f145
Derive Debug, start debugging
2023-04-14 23:38:36 +02:00
bitfl0wer
3e405169e3
add documentation
2023-04-14 23:01:48 +02:00
bitfl0wer
a8536df67e
make send_request return Option<Response>
2023-04-14 22:40:13 +02:00
bitfl0wer
f8da39b3d2
add send_request method
2023-04-14 22:22:23 +02:00
bitfl0wer
eb67dda8b0
Derive copy trait
2023-04-14 22:22:11 +02:00
bitfl0wer
91fd86d3fc
add new struct, send_request and can_send_request
2023-04-14 18:29:20 +02:00
bitfl0wer
599407373e
reduce code complexity& duplication, fix oversight
2023-04-14 17:11:13 +02:00
bitfl0wer
15d9c9af7e
reduce code duplication
2023-04-14 17:09:50 +02:00
bitfl0wer
d00296790f
handle resetting rate limits
2023-04-14 16:56:54 +02:00
bitfl0wer
2b1528564d
implement update limits
2023-04-12 22:59:08 +02:00
bitfl0wer
5cbbddf945
change return type from Limits to HashMap
2023-04-12 22:18:20 +02:00
bitfl0wer
6ca3bcd12c
make code compile
2023-04-12 18:34:20 +02:00
bitfl0wer
4b3cd3a5d3
add update_limits (TODO) and add_to_queue
2023-04-12 18:33:16 +02:00
bitfl0wer
ff9424f7ee
impl display for limittype, add limittype
2023-04-12 18:32:49 +02:00
bitfl0wer
910313d0ca
add .iter() to Limits
2023-04-12 18:18:55 +02:00
bitfl0wer
39a2c5340a
Optimize imports, allow dead code where needed
2023-04-12 17:10:12 +02:00
bitfl0wer
317c8e801e
refactor limit.rs, moved some logic
2023-04-12 16:49:18 +02:00
bitfl0wer
2d42423a1f
me when i write bad code
2023-04-12 15:49:12 +02:00
bitfl0wer
9795b8696c
Add todo
2023-04-11 21:27:37 +02:00
bitfl0wer
e8cad2a4ff
fix can_send_request
2023-04-11 21:27:06 +02:00
bitfl0wer
d71b9e13ab
add TODO comment
2023-04-10 21:02:29 +02:00
bitfl0wer
e633f0f3b3
add can_send_request, update_limits and send_requests
2023-04-10 20:58:07 +02:00
bitfl0wer
4060cbc29e
Add docstring, rename var
2023-04-10 17:35:04 +02:00
bitfl0wer
0c82c07685
remove tests, reformat limit display, rename limit
2023-04-10 17:30:02 +02:00
bitfl0wer
69247a9468
add: impl display for limit, check_limits
2023-04-10 17:20:02 +02:00
bitfl0wer
90020d0137
create new folder structure to map api routes
2023-04-10 14:19:31 +02:00
bitfl0wer
4eeb9895bc
create test to... test
2023-04-10 14:18:48 +02:00
bitfl0wer
8bee42aeaa
Remove http
2023-04-10 14:18:33 +02:00
bitfl0wer
e422785583
clean match and replace it with .unwrap_or_else
2023-04-08 23:56:53 +02:00
bitfl0wer
c2715d1fb6
get response body string out of result
2023-04-08 23:31:28 +02:00
bitfl0wer
3cdf24b284
add notes on what needs to be done.
2023-04-08 14:51:36 +02:00
bitfl0wer
8d30e1461b
Use Vec<Limit> instead of Limit because there are multiple limits
2023-04-08 14:37:20 +02:00
bitfl0wer
f237de7353
add bucket identifiers, add check_limits stub
2023-04-07 23:22:44 +02:00
bitfl0wer
1be125e80c
update use statement to match new name
2023-04-07 21:52:09 +02:00
bitfl0wer
f87bb89612
replace Box<> with VecDeque<>
2023-04-07 21:51:50 +02:00
bitfl0wer
5fbea48b76
start concepting/implementing RateLimiter
2023-04-07 21:01:48 +02:00
bitfl0wer
17a618e8f0
Indicate that code block is of type Rust
2023-04-05 22:19:15 +02:00
bitfl0wer
08d096e763
Create files
2023-04-05 21:55:27 +02:00
bitfl0wer
9609480fd7
Add url parser and tests
2023-04-05 21:54:27 +02:00
bitfl0wer
6f84797e98
main -> lib
2023-04-04 17:37:11 +02:00
bitfl0wer
93dc9f3197
cargo init
2023-04-04 16:42:20 +02:00