Commit Graph

949 Commits

Author SHA1 Message Date
kozabrada123 84ada8b94a Update src/types/utils/rights.rs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-29 16:05:27 +00:00
kozabrada123 b172e5910d Update src/types/utils/rights.rs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-29 16:04:49 +00:00
kozabrada123 552032a61e Capitalise docs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-29 16:04:08 +00:00
kozabrada123 e6dc44754c Forgot this since had the lint on my local copy 2023-07-29 11:45:25 +02:00
kozabrada123 b632958b0f Document some flags 2023-07-29 11:26:10 +02:00
kozabrada123 ede965411e Minor doc changes 2023-07-29 11:26:00 +02:00
kozabrada123 1e81a2682f Document rights 2023-07-29 11:00:28 +02:00
kozabrada123 83d4ffc4e8 Moar docs 2023-07-29 10:23:04 +02:00
kozabrada123 8eb2e2008c Remove the todos from the last commit 2023-07-28 18:57:35 +02:00
kozabrada123 d0547cb1f0 Better docs 2023-07-28 18:45:40 +02:00
kozabrada123 dcfb59fca1 Merge branch 'main' into fix/doc-improvements 2023-07-28 18:21:20 +02:00
Flori 07f283a205 Improve auto updating structs usage (#168)
* Add `GatewayHandle` to `UserMeta`

* Make user::shell async due to gateway add
2023-07-24 19:13:53 +02:00
SpecificProtagonist 9ebe72a7dc derive Updateable (#167) 2023-07-22 11:20:31 +02:00
Flori ccf44a5375 Auto updating structs (#163)
* Gateway fields don't need to be pub

* Add store to Gateway

* Add UpdateMessage trait

* Proof of concept: impl UpdateMessage for Channel

* Start working on auto updating structs

* Send entity updates over watch channel

* Add id to UpdateMessage

* Create trait Updateable

* Add documentation

* add gateway test

* Complete test

* Impl UpdateMessage::update() for ChannelUpdate

* Impl UpdateMessage::update() for ChannelUpdate
Co-authored by: SpecificProtagonist <specificprotagonist@posteo.org>

* make channel::modify no longer mutate Channel

* change modify call

* remove unused imports

* Allow dead code with TODO to remove it

* fix channel::modify test

* Update src/gateway.rs

Co-authored-by: SpecificProtagonist <vincentjunge@posteo.net>

---------

Co-authored-by: SpecificProtagonist <vincentjunge@posteo.net>
2023-07-21 15:35:31 +02:00
kozabrada123 44d9655e8e Merge stuff 2023-07-21 14:10:50 +02:00
SpecificProtagonist 776efce4dc Fix gateway heartbeat blocking (#162)
fix gateway heartbeat blocking
2023-07-21 13:59:40 +02:00
Flori 85fb24cd8c Fix: message file attachment duplication (#159)
* make send() take ownership of MessageSendSchema

* Remove message file attachment duplication

* Remove superfluous docstrings
2023-07-17 23:26:25 +02:00
Flori 1fdbe6cc00 Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:

**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user

**Changed:**
- `.gitignore`
  - Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha

**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`


## Commit log:

* Add .DS_store, remove Cargo.lock

* Create PrivateChannelCreateSchema

* pub use users

* add channels.rs

* create channels.rs

* Add Deserialize/Serialize derives

* Implement create_private_channel

* Add create_dm() test

* Make optional fields on `User` `Option<>`

* Check boxes for implemented features

* Create users/guilds.rs

* Remove unneeded import

* Add UserMeta::leave_guild()

* Create api/invites/mod.rs

* Add debug print to send_request

* Rename tests files

* Create invites.rs

* create invite.rs

* Add documentation

* Implement accept_invite

* Sort fields on Channel alphabetically

* Add invite mod

* Add forgotten teardown() at test end

* change visiblities, add create_user()

* Implement `create_user_invite()`

* start working on invite tests

* Add allow flags

* Fix bad url

* Create CreateChannelInviteSchema and friends

* remove non-implemented test code

* add body to requests

* Add Clone to UserMeta

* More comprehensive error message when running into a deserialization error

* Add arguments documentation to accept_invite

* Add Eq derive to GuildFeaturesList

* Add Eq derive to Emoji

* Add Eq derive to GuildBan

* Add create_accept_invite() test

* Add Default derive to ChannelCreateSchema

* Change create_guild_invite to return GuildInvite

* Dates as chrono::Date(Utc); sort alphabetically

* Add default derives wherever possible

* Implement add_- and remove_channel_recipient

* Create AddChannelRecipientSchema

* replace otheruser regs with bundle.creeate_user()

* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
Flori 6f3bd04963 Enable saving and loading LimitsConfiguration (#152)
Impl Serialize, Deserialize for LimitsConfiguration and children
2023-07-14 17:38:54 +02:00
SpecificProtagonist db0b1131ed Deduplicate gateway dispatch event handling (#148)
deduplicate gateway dispatch event handling
2023-07-11 20:11:13 +02:00
kozabrada123 a0d2fc8213 Add some docs 2023-07-11 19:54:04 +02:00
kozabrada123 3b35f03993 Merge branch 'main' into fix/doc-improvements 2023-07-11 19:24:37 +02:00
Zert3x 0d6d705e46 Async Observer Trait (#147) 2023-07-11 19:20:27 +02:00
kozabrada123 18ac7b5708 Rustdoc warnings + misc changes 2023-07-10 18:06:45 +02:00
kozabrada123 322894e4e9 UrlBundle slightly better docs 2023-07-10 17:22:31 +02:00
kozabrada123 192f12d892 /* -> /// 2023-07-10 16:59:00 +02:00
Flori 69b7c2445c Ratelimiter overhaul (#144)
* Rename limits and limit to have better names

* Remove empty lines

* Remove handle_request (moved to requestlimiter)

* Start working on new ratelimiter

* Make limits Option, add "limited?" to constructor

* Add missing logic to send_request

* Rename Limits

* Create Ratelimits and Limit Struct

* Define Limit

* Import Ratelimits

* Define get_rate_limits

* Remove unused import

* + check_rate_limits & limits_config_to_ratelimits

* Remove Absolute Limits
These limits are not meant to be tracked anyways.

* add ratelimits is_exhausted

* Add error handling and send request checking

* change limits to option ratelimits

* Add strum

* Change Ratelimits to Hashmap

* Remove ratelimits in favor of hashmap

* Change code from struct to hashmap

* start working on update rate limits

* Remove wrong import

* Rename ChorusLibError to ChorusError

* Documented the chorus errors

* Made error documentation docstring

* Make ReceivedErrorCodeError have error string

* Remove unneeded import

* Match changes in errors.rs

* Improve update_rate_limits and can_send_request

* add ratelimits.to_hash_map()

* use instances' client instead of new client

* add LimitsConfiguration to instance

* improve update_limits, change a method name

* Fix un-updated errors

* Get LimitConfiguration in a sane way

* Move common.rs into ratelimiter::ChorusRequest

* Delete common.rs

* Make instance.rs use overhauled errors

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* update ratelimiter implementation across all files

* Fix remaining errors post-refactor

* Changed Enum case to be correct

* Use result

* Re-add missing body to request

* Remove unneeded late initalization

* Change visibility from pub to pub(crate)
I feel like these core methods don't need to be exposed as public API.

* Remove unnecessary import

* Fix clippy warnings

* Add docstring

* Change Error names across all files

* Update Cargo.toml

Strum is not needed

* Update ratelimits.rs

* Update ratelimits.rs

* Bug/discord instance info unavailable (#146)

* Change text to be more ambigous

* Use default Configuration instead of erroring out

* Emit warning log if instance config cant be gotten

* Remove import

* Update src/instance.rs

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>

* Add missing closing bracket

* Put limits and limits_configuration as one struct

* Derive Hash

* remove import

* rename limits and limits_configuration

* Save clone call

* Change LimitsConfiguration to RateLimits
`LimitsConfiguration` is in no way related to whether the instance has API rate limits enabled or not. Therefore, it has been replaced with what it should have been all along.

* Add ensure_limit_in_map(), add `window` to `Limit`

* Remove unneeded var

* Remove import

* Clean up unneeded things
Dead code warnings have been supressed, but flagged as FIXME so they don't get forgotten. Anyone using tools like TODO Tree in VSCode can still see that they are there, however, they will not be shown as warnings anymore

* Remove nested submodule `limit`

* Add doc comments

* Add more doc comments

* Add some log messages to some methods

---------

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-09 18:38:02 +02:00
kozabrada123 3f6d0e2d9d Use log instead of prints 2023-07-01 19:29:50 +02:00
Vincent Junge 94a051631f require password to log in 2023-06-25 22:34:05 +02:00
Vincent Junge 8b0f41fad3 remove client side validation 2023-06-25 11:36:37 +02:00
Flori Weber c25795ab4d Make ReactionMeta::get() return Vec<PublicUser> 2023-06-23 12:54:08 +02:00
Flori Weber 6c9df9508e Fix stupid multi line comments 2023-06-23 12:18:22 +02:00
Flori 8fdbd7d84f Merge pull request #130 from polyphony-chat/refactor/change-channel-modify
Refactor/change channel modify
2023-06-22 20:05:15 +02:00
Flori Weber c00cc215fe Remove wrongful match statement 2023-06-22 19:54:39 +02:00
Flori 6c0faa29f3 Update src/api/channels/channels.rs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-06-22 19:42:07 +02:00
Flori Weber 7fb37ff204 Make Channel::modify() take &mut self 2023-06-22 18:56:16 +02:00
Vincent Junge d52acd9093 always use Snowflakes in args 2023-06-22 18:55:19 +02:00
Vincent Junge f98180cd03 ChorusResult type alias 2023-06-21 21:39:22 +02:00
Vincent Junge 709ef11f2c get channel messages 2023-06-21 14:46:45 +02:00
Flori Weber 62f6bfa363 Change send_request() calls to pass &mut Instance 2023-06-20 22:42:42 +02:00
Flori Weber 6650bcf1df Use Instance.client instead of creating a new one. 2023-06-20 22:42:08 +02:00
Flori Weber 6542a7a362 Add reqwest::Client to chorus::Instance. 2023-06-20 22:41:31 +02:00
Flori Weber 6eb3cf65d1 Change to single-line docstring 2023-06-20 22:36:39 +02:00
Flori Weber 20f39a409d Multiline docstring to single line docstring 2023-06-20 22:30:42 +02:00
Flori Weber 0f085491a0 Merge branch 'main' into refactor/reuse-reqwest-client 2023-06-20 22:21:08 +02:00
Flori Weber c08ec54f92 Change docstring from multi- to singleline 2023-06-20 22:20:06 +02:00
Flori a9dbde4122 Merge pull request #122 from SpecificProtagonist/winter
More consistent use of snowflakes
2023-06-20 22:16:54 +02:00
Vincent Junge 55b0f268e2 more consistent use of snowflakes 2023-06-20 22:03:29 +02:00
Flori 2c6becb361 Merge pull request #121 from polyphony-chat/fix/cannot-connect-to-discord
Remove unnecessary things
2023-06-20 21:54:53 +02:00
Flori 03df0ae9cf Merge pull request #114 from SpecificProtagonist/snowflake
Simplify Snowflake
2023-06-20 18:57:25 +02:00
Flori 225b6e4798 Merge pull request #117 from SpecificProtagonist/gateway-event
Simplify GatewayEvent
2023-06-20 18:57:13 +02:00
kozabrada123 cd98de286f Change Option<ChorusLibError> to Result<(), ChorusLibError> 2023-06-20 18:26:30 +02:00
Vincent Junge 1df01512d7 simplify GatewayEvent 2023-06-20 16:12:13 +02:00
Vincent Junge 9c7031abde UrlBundle remove getters 2023-06-20 12:29:52 +02:00
Vincent Junge f9619dde8d simplyfy Snowflake 2023-06-20 12:21:22 +02:00
Flori Weber a5afada13f Remove unnecessary things 2023-06-20 00:35:46 +02:00
Flori Weber ec3a531f48 apply clippy suggestions 2023-06-19 19:01:18 +02:00
Flori Weber 5dbb627322 change post to delete 2023-06-19 18:12:09 +02:00
Flori Weber 51e7cc003a Add Eq, PartialEq derives 2023-06-19 18:12:01 +02:00
Vincent Junge c06778fc71 Fix clippy::await_holding_refcell_ref false positives 2023-06-19 16:46:58 +02:00
Flori Weber cac12decad Fix build failing 2023-06-19 16:11:53 +02:00
Vincent Junge f0241e0756 Make MessageSendSchema fields public 2023-06-19 14:21:27 +02:00
Vincent Junge 208eeac536 Fix various Clippy lints 2023-06-19 12:35:07 +02:00
Flori Weber 1cb672faa6 Add remove_relationship 2023-06-18 23:10:29 +02:00
Flori Weber f658f3fe61 Remove unneccessary imports 2023-06-18 23:04:25 +02:00
Flori Weber 8c68e8bd77 Add modify_user_relationship 2023-06-18 23:02:49 +02:00
Flori Weber fa524b1791 Fix errors not displayed, add InvalidArgumentsErr 2023-06-18 23:01:38 +02:00
Flori Weber 3aa162cfc7 Move FriendRequestSchema to schemas 2023-06-18 19:05:09 +02:00
Flori Weber 3102ea8057 Create relationship schemes 2023-06-18 19:04:55 +02:00
Flori Weber 9b52ceab4b Change returns, add documentation 2023-06-18 15:39:52 +02:00
Flori Weber 94ae449f7d Start implementing get_relationship 2023-06-18 14:00:12 +02:00
Flori Weber 2e6e9ad59d Add FriendRequestSendSchema 2023-06-15 19:01:01 +02:00
Flori Weber c2d46196c8 Implement send_friend_request 2023-06-15 19:00:47 +02:00
Flori Weber 28881276e0 Add get_mutual_relationships 2023-06-14 22:54:14 +02:00
Flori Weber 7e4b4269b6 Change belongs_to to be borrowed non-mutably 2023-06-14 22:53:56 +02:00
Flori Weber e14a21f814 Format relationships.rs 2023-06-14 22:14:56 +02:00
Flori Weber 7202722eb1 Add relationships.rs 2023-06-14 22:14:48 +02:00
Flori Weber 57fc5ba860 Update link reference 2023-06-13 15:23:39 +02:00
Flori Weber cefc522e2f Update relationship.rs types 2023-06-13 15:23:06 +02:00
Flori Weber 2e84385007 Create relationships.rs 2023-06-13 14:04:58 +02:00
Flori Weber 616d8a1bf0 Create relationships.rs 2023-06-13 14:04:39 +02:00
bitfl0wer 7a3524a1ab run cargo fix 2023-06-12 18:59:06 +02:00
bitfl0wer 9bbe9fc470 run cargo fix 2023-06-12 18:58:53 +02:00
bitfl0wer c97fa7bc48 Remove unneccessary variable 2023-06-12 18:55:27 +02:00
bitfl0wer 44224cb478 Refactor limited requester
The requester does not need to be instantiated anymore, which makes things easier to read imo.
2023-06-12 18:51:54 +02:00
Flori Weber 057e8e552f Refactor users.rs to use api::common 2023-06-11 21:40:03 +02:00
Flori Weber 6db823cb48 Refactor roles.rs to use api::common 2023-06-11 20:04:40 +02:00
Flori Weber 893d1be98a Refactor member.rs to use api::common 2023-06-11 19:30:15 +02:00
Flori Weber d10f268ae5 Refactor guilds.rs to use api:common 2023-06-11 19:26:34 +02:00
Flori Weber c8e4268638 Use handle_request_as_option instead 2023-06-11 19:22:28 +02:00
Flori Weber e0a6b37a94 Introduce handle_request_as_option 2023-06-11 19:22:10 +02:00
Flori Weber 8d6fab0858 Refactor reactions to use api::options 2023-06-11 19:13:38 +02:00
Flori Weber 876cbd319d Refactor permissions.rs to use api::common 2023-06-11 17:56:29 +02:00
Flori Weber 96b82377d8 Remove import 2023-06-11 17:51:26 +02:00
Flori Weber 06e27e816c Refactor Message::send() 2023-06-11 17:49:42 +02:00
Flori Weber 5a0bf4b570 Make some fields Option enum 2023-06-11 17:49:30 +02:00
Flori Weber 99aa44daa8 Refactor to use api common, return Message instead 2023-06-11 17:40:44 +02:00
Flori Weber 0d8505121d Refactor channels.rs to use api::common 2023-06-11 17:36:04 +02:00
Flori Weber 120469453b Add argument to specify which LimitType to use 2023-06-11 17:35:47 +02:00
Flori Weber 4305f035f0 Move common request code into common.rs 2023-06-11 17:21:09 +02:00
Flori Weber 9b6a3c2fa6 Merge branch 'main' into feature/permissions-and-roles 2023-06-11 15:34:43 +02:00
Flori Weber 1dbc05d48c create common.rs 2023-06-11 15:34:05 +02:00
kozabrada123 3237e7b7b7 Reformat and cargo fix 2023-06-11 14:32:37 +02:00
Flori Weber a5a596fb4b Cargo fix 2023-06-11 13:55:00 +02:00
Flori Weber 63f09e51d8 Cargo fix 2023-06-11 13:54:54 +02:00
Flori Weber c745861592 Reformat entire project, optimize imports 2023-06-11 13:52:53 +02:00
Flori Weber f641dbb14f Reformat entire project, optimize imports 2023-06-11 13:52:31 +02:00
kozabrada123 b61bc573b7 Merge branch 'main' into perpetual/gateway-dev 2023-06-11 09:10:03 +02:00
bitfl0wer 9940394f20 Implement delete_permission 2023-06-10 22:16:53 +02:00
bitfl0wer b20fc61aea impl Channel::edit_permissions() 2023-06-10 22:09:53 +02:00
bitfl0wer 6b1dd90355 Create permissions.rs 2023-06-10 21:51:45 +02:00
Flori Weber 7d321798ee "Normalize" RolePositionUpdateSchema 2023-06-10 19:35:57 +02:00
Flori Weber f5fba7c34a Better error handling in get methods. 2023-06-10 18:50:49 +02:00
Flori Weber f0e3933419 Implement RoleObject::get() 2023-06-10 18:48:37 +02:00
Flori Weber 2652ae68e0 Add RoleObject::update() 2023-06-10 18:42:37 +02:00
kozabrada123 17194a2fcc Implement display for UserStatus 2023-06-10 16:56:50 +02:00
kozabrada123 3db9114ecf turns out UpdatePresence and PresenceUpdate are different events 2023-06-10 16:32:42 +02:00
kozabrada123 78e63657c8 Change observer update ref to &mut from & 2023-06-10 15:37:02 +02:00
Flori Weber 6070ad8e0a Implement GuildMember::get() 2023-06-10 15:16:45 +02:00
kozabrada123 d5b883a088 Refactor, better deserialization error handling 2023-06-10 12:43:07 +02:00
kozabrada123 ecc6fc9424 Merge branch 'main' into perpetual/gateway-dev 2023-06-10 10:30:54 +02:00
bitfl0wer 972100af65 Change UserMeta: User instead of Option<User>
I do not know why I have made it optional in the first place. hm
2023-06-10 00:35:51 +02:00
bitfl0wer 9fb6c8c6f9 implement GuildMember::remove_role() 2023-06-10 00:10:12 +02:00
bitfl0wer e4fb36d914 Implement GuildMember::add_role() 2023-06-10 00:03:31 +02:00
bitfl0wer ce59beab3a create member.rs 2023-06-09 23:41:40 +02:00
bitfl0wer 777746bc00 Add from_vec()
Calculates a PermissionFlags Stirng from a Vec<PermissionFlags>.
2023-06-09 21:34:54 +02:00
bitfl0wer 76e038b103 Remove unused import 2023-06-09 20:49:02 +02:00
bitfl0wer 2d828f2fdb Move role schemas to own file 2023-06-09 20:47:45 +02:00
kozabrada123 a278b63ecb Docs + unneeded &mut 2023-06-09 20:22:59 +02:00
kozabrada123 dc2fc90414 Discord.com sends premissions as an integer 2023-06-09 18:38:36 +02:00
kozabrada123 10617ca85c Rebase 2023-06-09 18:14:20 +02:00
bitfl0wer 6ed9eaf2fc Implement RoleObject::position_update() 2023-06-09 16:50:03 +02:00
bitfl0wer 2c153259b3 Change Role to have String over PermissionFlags
PermissionFlags implementation needs to be figured out a bit better before we can use it here.
2023-06-09 12:04:49 +02:00
bitfl0wer 47f8b131a3 Add documentation 2023-06-08 22:39:06 +02:00
bitfl0wer f41312d430 Implement RoleObject::create() 2023-06-08 22:26:24 +02:00
bitfl0wer 951e41db4b Add FormCreationError 2023-06-08 22:26:08 +02:00
bitfl0wer b0a19faa48 Change InstanceServerError to ChorusLibError
The name InstanceServerError was chosen without thinking about it too much, very early in development. The new name suits this custom Error type way better, in my opinion.
2023-06-08 22:16:23 +02:00
bitfl0wer 8b35c5948d Add RolePositionUpdateSchema 2023-06-08 20:45:56 +02:00
bitfl0wer 925165aba2 Change struct name
This schema is being used as a RoleModifySchema AND as a RoleCreationSchema.
2023-06-08 20:43:29 +02:00
bitfl0wer 4547e8b2d6 Add misssing attribute 2023-06-08 20:42:40 +02:00
bitfl0wer 46fac4b132 Add RoleCreateSchema 2023-06-08 20:40:36 +02:00
kozabrada123 88d571486b Basic tests 2023-06-08 19:51:32 +02:00
kozabrada123 da98f3c581 Refactor 2023-06-08 18:24:11 +02:00
kozabrada123 74785b4b2b Merge branch 'main' into perpetual/gateway-dev 2023-06-08 17:35:17 +02:00
kozabrada123 a0629bf198 Gateway basic error handling 2023-06-08 17:34:52 +02:00
bitfl0wer 15a122d719 cargo fix 2023-06-07 23:06:52 +02:00
bitfl0wer 1381bbfcbf Remove unnecessary imports 2023-06-07 23:03:37 +02:00
bitfl0wer acbbc88e84 Implement RoleObject::get_all() 2023-06-07 23:03:24 +02:00
bitfl0wer 990f9eb4e2 Create roles.rs 2023-06-07 23:03:07 +02:00
bitfl0wer 91ede88140 Try making permissions to PermissionFlags 2023-06-07 22:44:16 +02:00
bitfl0wer 1d701c185f Sort fields on Guild alphabetically 2023-06-07 22:40:48 +02:00
bitfl0wer cf74d0e618 Make enum into bitflags struct 2023-06-07 10:39:05 +02:00
bitfl0wer e65aa964f0 Fix enum, add has_permission() for RoleObject 2023-06-06 21:38:28 +02:00
bitfl0wer 3cd633f7ad Make enum pub 2023-06-06 20:10:50 +02:00
bitfl0wer e07387fc77 Add PermissionFlags 2023-06-06 20:05:34 +02:00
bitfl0wer 3692f15f0f Add reference to docs 2023-06-04 14:41:24 +02:00
bitfl0wer 0a106d2e1d Add method to remove own reaction 2023-06-04 14:39:22 +02:00
bitfl0wer 7a811e1792 improve existing documentation 2023-06-04 14:32:57 +02:00
bitfl0wer 359bfc7b8b Add delete_user method 2023-06-04 14:29:43 +02:00
bitfl0wer 92e768d5a6 Change file structure 2023-06-04 14:20:06 +02:00
kozabrada123 8f6c533e50 Implement Clone for all events 2023-06-04 13:49:35 +02:00
kozabrada123 9bad8ab4fa Merge branch 'main' into perpetual/gateway-dev 2023-06-04 10:18:16 +02:00
bitfl0wer 5dd9d095cf Move some pieces of documentation to where they make the most sense 2023-06-03 22:34:03 +02:00
bitfl0wer 9918b9a71d Make reference links clickable in cargo doc 2023-06-03 22:15:03 +02:00
bitfl0wer b5de178a91 Add references 2023-06-03 22:08:56 +02:00
bitfl0wer 065bb28c96 Add create reaction with documentation 2023-06-03 22:07:37 +02:00
bitfl0wer 33e0f75772 Add delete_emoji method with documentation 2023-06-03 20:17:21 +02:00
bitfl0wer 4d6ad1cd7b Add documentation 2023-06-03 18:59:13 +02:00
bitfl0wer be512504c5 Add reactions: get 2023-06-03 18:53:53 +02:00
bitfl0wer da0726c538 Implement reactions: delete all 2023-06-03 18:46:36 +02:00
bitfl0wer df6fcbd5ee Add ReactionMeta struct 2023-06-03 15:21:49 +02:00
kozabrada123 151ae4250a Features is not always sent 2023-06-02 11:00:34 +02:00
kozabrada123 2309c957d4 Merge branch 'perpetual/gateway-dev' of https://github.com/polyphony-chat/chorus into perpetual/gateway-dev 2023-06-02 10:58:22 +02:00
kozabrada123 a4b21072ab fmt 2023-06-02 10:58:04 +02:00
kozabrada123 554810862d Handle Heartbeat ACKs 2023-06-02 10:57:47 +02:00
kozabrada123 0192f1452d Handle Heartbeat requests 2023-06-02 10:42:19 +02:00
bitfl0wer e9d5384f02 Create reactions.rs 2023-06-01 21:14:11 +02:00
bitfl0wer e61546e442 Remove mod 2023-06-01 21:14:02 +02:00
Flori db1afb4578 Merge pull request #83 from polyphony-chat/refactor/less-boilerplate
Refactor/less boilerplate
2023-05-30 23:11:47 +02:00
bitfl0wer 9943fcc55f Refactored users() as much as possible 2023-05-30 23:04:22 +02:00
Quaternion fefc6a68f9 make the tests pass 2023-05-30 10:57:34 -04:00
Zert3x 8ccd6a8d4b Merge branch 'main' into refactor/rename-apierror 2023-05-29 22:25:02 -04:00
bitfl0wer 315c5a00cf Refactor channels() 2023-05-29 23:59:13 +02:00
bitfl0wer 671c5d6191 Refactor create 2023-05-29 23:57:23 +02:00
bitfl0wer 03e5a83d84 Refactor delete() 2023-05-29 23:51:12 +02:00
bitfl0wer b501aca5b2 Refactor create() and get() 2023-05-29 23:46:43 +02:00
bitfl0wer f986b33878 Remove unnecessary lifetime 2023-05-29 23:46:17 +02:00
bitfl0wer 69993820f9 Refactor Guild create 2023-05-29 23:16:43 +02:00
bitfl0wer c43e861586 Refactor message::send() 2023-05-29 23:15:05 +02:00
bitfl0wer 072d99e879 Refactor modify() to take less boilerplate args 2023-05-29 23:11:12 +02:00
bitfl0wer ebeaf31343 Refactor delete() to take less boilerplate args 2023-05-29 23:08:52 +02:00
bitfl0wer 3e4840d7a6 Refactor get() to take less boilerplate args 2023-05-29 23:01:17 +02:00
bitfl0wer 84b3b72928 Add clone, default derives 2023-05-29 18:50:19 +02:00
bitfl0wer f8655c22bc Make all attributes pub 2023-05-29 18:34:08 +02:00
bitfl0wer 6cb400b3d0 Add modify() 2023-05-29 18:27:30 +02:00
bitfl0wer 572ff07b93 Add ChannelModifySchema 2023-05-29 18:27:15 +02:00
Flori 7ada53a4d4 Merge pull request #81 from polyphony-chat/feature/channel/delete
Feature/channel/delete
2023-05-29 17:56:13 +02:00
bitfl0wer 4bac730e14 Implement User methods on User instead of UserMeta 2023-05-29 17:25:34 +02:00
kozabrada123 24a79b18e2 Fix typo 2023-05-29 17:18:52 +02:00
kozabrada123 9d546ef2a5 Fix some errors caused by the observer return fix 2023-05-29 17:11:08 +02:00
bitfl0wer 1f739ebfb7 Made Guild::create return Guild instead of String.
This makes way more sense, I think.
2023-05-29 16:50:10 +02:00
bitfl0wer aa28fbe1cd Changed some apparently incorrect attributes
Some attributes are not necessarily returned by the GET route for a guild. Also, some integers were too small. One example is max_video_channel_users, which was a u8, but could theoretically be a value much higher than u8::MAX.
2023-05-29 16:49:36 +02:00
bitfl0wer 3fe3e2a461 Remove print statement 2023-05-28 23:08:13 +02:00
bitfl0wer fdc1da9af7 Remove print statement 2023-05-28 23:08:05 +02:00
bitfl0wer 1fb3ef6766 Create channels() for Guild
This method retrieves all channels from a guild
2023-05-28 23:04:35 +02:00
bitfl0wer 84505829c4 Make delete use self 2023-05-28 23:04:13 +02:00
bitfl0wer 8e8556ee53 Add InvalidResponseError 2023-05-28 23:04:02 +02:00
bitfl0wer f2824f3a81 Add documentation 2023-05-28 22:40:37 +02:00
bitfl0wer a189d2baaa Make channel delete take ownership of a Channel 2023-05-28 22:39:38 +02:00
bitfl0wer ed330859bd Add channel delete method 2023-05-28 22:39:25 +02:00
kozabrada123 7e37d2df42 Fix weird observer subscribe return 2023-05-28 17:37:05 +02:00
kozabrada123 6c2e29228f u16 is too small for flags apparently 2023-05-28 17:36:30 +02:00
kozabrada123 6d90980bf4 Members is optional 2023-05-28 17:36:12 +02:00
kozabrada123 0fd7b304ad agjbg??! 2023-05-28 14:52:48 +02:00
kozabrada123 51097b3a41 71 conflicts due to fmt?!?!?!?! 2023-05-28 14:52:08 +02:00
kozabrada123 da27692b53 Gateway opcode constants and small refactor 2023-05-28 14:39:41 +02:00
kozabrada123 d233b82243 More stability 2023-05-28 08:43:22 +02:00
Quaternion c4d5b43fa6 Hijack this to make User::flags pub 2023-05-28 02:42:35 -04:00
Quaternion cb6a4352bc Add custom implementation to allow simple-array behaviour for GuildFeatures 2023-05-28 02:42:09 -04:00
Quaternion 6bae67a862 Change integer datatypes to be 'i32' as required by sqlx 2023-05-28 02:39:24 -04:00
kozabrada123 63cfebdf5a Stability, new event 2023-05-28 08:18:50 +02:00
Quaternion f689496f20 merge main 2023-05-27 19:54:43 -04:00
bitfl0wer 0a99e1637b run cargo fmt && cargo fix 2023-05-28 00:50:52 +02:00
bitfl0wer b83f90f8dc Move test to tests-dir 2023-05-27 22:51:43 +02:00
bitfl0wer b1760af9d2 Remove empty test 2023-05-27 22:47:46 +02:00
bitfl0wer efe101675c Make password optional 2023-05-27 22:46:43 +02:00
bitfl0wer a3c800c3d9 Move tests to tests/-dir 2023-05-27 22:46:27 +02:00
bitfl0wer 2ae221f1ee Fix build 2023-05-27 20:54:43 +02:00
bitfl0wer c715ca9838 Merge branch 'refactor/application-default' 2023-05-27 20:46:19 +02:00
kozabrada123 262365e23f Add options with empty string for identify props 2023-05-27 19:55:57 +02:00
Quaternion 9b343c604e uncomment, oops 2023-05-27 13:50:55 -04:00
Quaternion 16e050bd48 rename APIError in ErrorField vec as well 2023-05-27 13:50:28 -04:00
Quaternion 1c55b90f06 Hijack this to clean up ApplicationCommandOptionType with serde_repr 2023-05-27 13:46:37 -04:00
Quaternion 3e5e79929c Add custom Default impl to Application 2023-05-27 13:45:56 -04:00
Quaternion 24be5c0144 Rename APIError -> APIErrorPayload to solve conflicting name 2023-05-27 13:41:23 -04:00
bitfl0wer 7f707d337e Fix typos 2023-05-27 19:36:07 +02:00
kozabrada123 12a04e866a Merge branch 'main' into feature/full-gateway-coverage 2023-05-27 19:23:27 +02:00
Quaternion de5157299d remove message field 2023-05-27 11:40:20 -04:00
kozabrada123 e48047266a Remove dumping gateway events into stdout 2023-05-27 17:33:19 +02:00
kozabrada123 420624c428 Better unrecognised messages 2023-05-27 17:31:55 +02:00
kozabrada123 6f6713eb79 Add Application Command Permissions & Update event 2023-05-27 17:29:30 +02:00
kozabrada123 fb863d9186 Add InteractionCreate 2023-05-27 17:11:47 +02:00
kozabrada123 0b12724003 Add Stage Instance & events 2023-05-27 17:05:25 +02:00
kozabrada123 ce0af48f7f Add Auto Moderation types & events 2023-05-27 16:50:38 +02:00
kozabrada123 51c786661e Add Relationship & related events 2023-05-27 16:03:23 +02:00
kozabrada123 e2d07ec7a6 Add "Discord Client" option 2023-05-27 13:16:40 +02:00
kozabrada123 ccfbdb32c6 Document more gateway props options 2023-05-27 13:05:59 +02:00
kozabrada123 0fd800c4c2 Fix some deserialization errors 2023-05-27 13:05:36 +02:00
kozabrada123 6932e567b7 Fix a types mismatch 2023-05-27 09:58:10 +02:00
kozabrada123 bab226cd24 Fix stack overflow due to infinite recursion
I am dumb
2023-05-27 09:57:46 +02:00
kozabrada123 c2398f2900 Add a sensible defaults for Identify and its props 2023-05-27 09:21:26 +02:00
Quaternion 0958e1e63b Revert "Add back settings and extended_settings fields to User"
This reverts commit 04813967c2.
2023-05-27 00:24:37 -04:00
Quaternion 7e91597c44 Revert "fix imports"
This reverts commit 3e5ee02740.
2023-05-27 00:24:32 -04:00
Quaternion 3e5ee02740 fix imports 2023-05-27 00:12:05 -04:00
Quaternion 04813967c2 Add back settings and extended_settings fields to User 2023-05-27 00:07:07 -04:00
Quaternion f88276cb9a Add PartialEq, Clone, Copy to Component 2023-05-26 22:44:43 -04:00
Quaternion 5047c7168c Add forgotten derives to UnvailableGuild/GuildCreateResponse 2023-05-26 22:38:39 -04:00
Quaternion 335f3a11dd Add forgotten feature lock to UserTheme 2023-05-26 22:38:16 -04:00
Quaternion d02df9fc50 Add forgotten derives to Emoji 2023-05-26 22:37:20 -04:00
Quaternion f642cb05b0 Extract private fields to symfonia, type lock fields 2023-05-26 22:29:20 -04:00
Quaternion 4164d0c8cf serde(skip) ids where full objects are returned 2023-05-26 16:24:42 -04:00
Quaternion e2e325ceab serde(skip) ids where full objects are returned 2023-05-26 16:23:33 -04:00
Quaternion 192f352b56 Flesh out and properly feature lock fields on Attachment 2023-05-26 16:00:15 -04:00
Quaternion a2ac6461f2 Flesh out and properly feature lock fields on Application 2023-05-26 15:25:40 -04:00
Quaternion 11bae90145 Add feature locks to Emoji 2023-05-26 14:09:03 -04:00
Quaternion b1be1ec503 Add feature locks to Channel 2023-05-26 14:08:53 -04:00
kozabrada123 57c69e9dac Types refactor 2023-05-26 19:47:41 +02:00
kozabrada123 63e67f64fd Types refactor merged 2023-05-26 19:36:41 +02:00
Quaternion 6dff6cf8e8 Simplify locks 2023-05-26 11:54:07 -04:00
Quaternion 7053d63ebc Simplify locks 2023-05-26 11:44:02 -04:00
Quaternion bb8f34b751 Un-lock mod errors 2023-05-26 10:23:11 -04:00
Quaternion 1bc7eb6a6e Lock client specific code behind feature 2023-05-26 10:16:08 -04:00
Quaternion c24c57d8a7 Convert Channel::guild_id to Snowflake 2023-05-26 09:59:36 -04:00
Quaternion 0450c27fbf Serde_repr on ChannelType 2023-05-26 09:58:13 -04:00
bitfl0wer 4360dcbf23 remove internal only attributes 2023-05-26 13:17:27 +02:00
bitfl0wer 3353a2f461 Prettify imports, remove outdated types/schemas 2023-05-26 12:59:32 +02:00
bitfl0wer ba93db0be8 Run cargo fix 2023-05-26 12:53:57 +02:00
bitfl0wer 5b324db391 Finish refactor 2023-05-26 12:50:16 +02:00
bitfl0wer f74b9c4c0d start porting over new types folder 2023-05-25 23:09:18 +02:00
bitfl0wer 48113825b8 Integrate polyphony-types into chorus 2023-05-25 21:11:08 +02:00
kozabrada123 3b07195a1f Build error after merge fixed 2023-05-24 16:27:04 +02:00
kozabrada123 9b9df72e22 Merge branch 'main' into feature/full-gateway-coverage 2023-05-24 16:23:00 +02:00
kozabrada123 f1a10478a8 Merge main / rebase + merge conflict fix 2023-05-24 16:22:22 +02:00
bitfl0wer 7493597f4f Move Channels::get() to channels.rs 2023-05-23 16:28:25 +02:00
bitfl0wer 44f9f2cae5 Create channels.rs 2023-05-23 16:28:09 +02:00
bitfl0wer 8136bfa9a5 Fix: Used wrong rout to retrieve singular channel 2023-05-23 16:25:08 +02:00
bitfl0wer 368152e092 Make Channel type derive Eq, PartialEq recursively 2023-05-23 15:25:32 +02:00
bitfl0wer f4f01a00cc Revert "Add ChannelType enum"
This reverts commit b293f5ed96.
2023-05-23 15:17:04 +02:00
bitfl0wer 420f3798f4 try flattening the enum to fix CI 2023-05-23 15:10:56 +02:00
bitfl0wer 64693c8770 Add todo 2023-05-23 14:51:28 +02:00
bitfl0wer b293f5ed96 Add ChannelType enum 2023-05-23 14:50:48 +02:00
bitfl0wer 912d8043d0 Replace URL in errors with full route URL 2023-05-23 14:38:03 +02:00
bitfl0wer 9a6a08bb67 Implement get() for channel 2023-05-23 14:37:34 +02:00
bitfl0wer fd0442dcc9 Start working on get() channel route 2023-05-23 14:31:21 +02:00
bitfl0wer 81885cffc0 Change create channel method to return Channel
Previously returned a Response object.
2023-05-23 13:50:39 +02:00
bitfl0wer fc55a53ed5 Implement create channel methods 2023-05-23 13:06:09 +02:00
bitfl0wer 69425f18ac start working on channel create 2023-05-22 23:22:34 +02:00
kozabrada123 ae21139213 Add Voice StateUpdate and ServerUpdate events 2023-05-22 18:42:12 +02:00
kozabrada123 d2b5fb7d72 Add GuildScheduledEvent Events (pt 2) 2023-05-22 16:46:49 +02:00
kozabrada123 e54ad258f8 Add GuildScheduledEvent Events 2023-05-22 16:43:06 +02:00
kozabrada123 5dec2dbf36 Remove unused 2023-05-22 15:57:37 +02:00
kozabrada123 73a9e5b0fc Merge branch 'main' 2023-05-22 13:30:19 +02:00
bitfl0wer 5af2216882 move integration test from guild to integration.rs 2023-05-21 16:02:54 +02:00
bitfl0wer 5e5be4a9b4 Add delete() to User 2023-05-21 15:05:02 +02:00
bitfl0wer 8aa4dea9c4 Fix 'already borrowed: BorrowMutError' 2023-05-20 23:21:24 +02:00
bitfl0wer 8a1c1f0a41 Replace &mut Instance with Rc<RefCell<Instance>>
Replace &mut Instance with Rc<RefCell<Instance>> on the User struct to represent the 1:n relation of Instance:User
2023-05-20 23:10:25 +02:00
kozabrada123 ed144e723d Add Guild Audit Log Entry Create 2023-05-20 13:03:44 +02:00
kozabrada123 6ceaee4f14 Add Invite Create & Delete 2023-05-20 12:50:05 +02:00
kozabrada123 b207521bbd Add Passive Update V1 2023-05-20 09:35:48 +02:00
kozabrada123 1a98e7db6b Duplicate VoiceState 2023-05-20 08:59:14 +02:00
kozabrada123 50fb208023 Update dependencies, deserialize errors 2023-05-20 08:39:02 +02:00
kozabrada123 2bc24ed949 Merge pull request #60 from polyphony-chat/main
Rebase feature/fgc
2023-05-20 08:37:34 +02:00
kozabrada123 f33411e6c3 Solve deserialization problem semi optimally 2023-05-17 18:16:47 +02:00
kozabrada123 ae06991be6 Revert "Deserialize from String" (Ugh)
This reverts commit 79eb3e3b30.

If course I can't just do that, ugh
Keeping the formatting would require using RawValue, but as we use one struct for sending an recieving, having to make RawValue to send would be pretty dumb
2023-05-17 17:24:29 +02:00
kozabrada123 79eb3e3b30 Deserialize from String instead of Value 2023-05-17 17:03:03 +02:00
kozabrada123 57dd0978dd Some minor changes 2023-05-17 16:24:04 +02:00
bitfl0wer 376ae83f58 Implement modify(), untested as of now 2023-05-16 15:59:23 +02:00
bitfl0wer 29318e9085 Add UserModifySchema 2023-05-16 15:59:06 +02:00
bitfl0wer a1397cf46f Add PasswordRequiredError 2023-05-16 15:58:51 +02:00
bitfl0wer fbd9170806 Start working on User::modify(). 2023-05-15 23:20:23 +02:00
kozabrada123 2b4786b4bb Fix spelling mistake, add minor docs 2023-05-15 20:54:16 +02:00
kozabrada123 a977d97684 Fix some deser errors, add CHANNEL_UNREAD_UPDATE 2023-05-15 20:45:33 +02:00
kozabrada123 32d160db64 Merge pull request #58 from polyphony-chat/main
Bring full-gateway-coverage up to date from main
2023-05-15 12:42:06 +00:00
bitfl0wer aaa16ef532 remove accidental doctests 2023-05-14 22:47:34 +02:00
bitfl0wer e552bdb352 make fields on GuildCreateSchema pub 2023-05-14 22:45:55 +02:00
bitfl0wer b4cc8fd64b add type guildcreateresponse 2023-05-14 22:45:42 +02:00
bitfl0wer fbfd0e627f Remove unused import 2023-05-14 22:45:31 +02:00
bitfl0wer 120cdfd14f Change function signatures, add tests 2023-05-14 22:45:18 +02:00
kozabrada123 7e6507c206 Fix some gateway deserialization errors 2023-05-14 19:55:43 +02:00
kozabrada123 fcbca459dc Add some Guild, Integration and Webhook events 2023-05-14 15:55:20 +02:00
kozabrada123 0173ca9e62 Add session, guild event types 2023-05-14 15:37:30 +02:00
bitfl0wer 833c3733d7 Add guild delete route 2023-05-14 14:16:21 +02:00
kozabrada123 1b0456c5c3 Merge branch 'feature/full-gateway-coverage' into feature/rest-of-discord-types 2023-05-14 12:05:26 +00:00
kozabrada123 2ff5e4fd9d Add Readies to Events, try to fix msg_create error 2023-05-14 14:03:18 +02:00
bitfl0wer d797a10009 Add RateLimit information 2023-05-14 13:12:02 +02:00
bitfl0wer 4b4adbe1cc impl ToString for LimitType 2023-05-14 13:11:50 +02:00
bitfl0wer 598ad093a1 Improve error handling on request sending 2023-05-14 13:07:46 +02:00
bitfl0wer d5103ea03f Merge branch 'feature/rest-of-discord-types' into feature/guild-creation-deletion 2023-05-14 12:55:39 +02:00
bitfl0wer 9b1a7f9bd8 Remove duplicate VoiceState 2023-05-14 12:55:19 +02:00
bitfl0wer bb546cdc82 Merge branch 'feature/rest-of-discord-types' into feature/guild-creation-deletion 2023-05-14 12:52:25 +02:00
bitfl0wer 2072ae11a5 Add full Guild type 2023-05-14 12:40:31 +02:00
kozabrada123 2209d967cd Flatten, new events 2023-05-14 11:43:17 +02:00
kozabrada123 40b459b974 Add call update and delete 2023-05-14 08:39:23 +02:00
kozabrada123 262cd0e780 Add more events, fix deserialization errors 2023-05-14 08:20:25 +02:00
bitfl0wer 51ecf888b8 remove get() 2023-05-13 23:45:49 +02:00
bitfl0wer 3fca30db35 start implementing get() 2023-05-13 23:15:28 +02:00
bitfl0wer ea454228ac Add documentation 2023-05-13 22:55:17 +02:00
bitfl0wer 1934622e4c Implement Guild::create() 2023-05-13 22:14:53 +02:00
bitfl0wer e0a45edb3c Add GuildCreateSchema as per Spacebar Docs 2023-05-13 22:11:06 +02:00
bitfl0wer 5031db6547 Update docs, remove panic in favor of Err Result 2023-05-13 22:10:46 +02:00
bitfl0wer c436fdb857 Remove panic on send_request error 2023-05-13 22:06:44 +02:00
kozabrada123 a93962b667 Add Stage Instance and Voice State 2023-05-13 22:01:04 +02:00
kozabrada123 4e51d1251b Add integrations 2023-05-13 21:50:36 +02:00
bitfl0wer ca8f94c18e create src/api/guilds/guilds.rs 2023-05-13 21:42:43 +02:00
kozabrada123 0c3e99057f Add channel and thread types, start guild 2023-05-13 21:27:44 +02:00
kozabrada123 e3a5a532c3 Merge branch 'polyphony-chat:main' into main 2023-05-13 14:49:53 +00:00
kozabrada123 a3969e8cb6 Small changes for merging 2023-05-13 16:43:29 +02:00
bitfl0wer 3c6a549db7 Fix tests 2023-05-13 16:42:24 +02:00
bitfl0wer 092eed6957 update file to one that always exists, fix test 2023-05-13 16:40:34 +02:00
bitfl0wer c74e40e5f9 comment out view_nsfw_guilds to fix tests 2023-05-13 16:36:28 +02:00
kozabrada123 9a80f68787 Warnings 2023-05-13 16:35:42 +02:00
kozabrada123 4765b7a362 WebSocketConnection are no longer used 2023-05-13 16:34:05 +02:00
kozabrada123 41b75be2fb Add a few more gateway events 2023-05-13 16:24:34 +02:00
kozabrada123 11d371eee2 Add rest of send events 2023-05-13 15:59:46 +02:00
kozabrada123 595716afc5 Small unit test update 2023-05-13 15:36:29 +02:00
kozabrada123 bcb97977f7 Remove terrible debug messages 2023-05-13 09:54:23 +02:00
kozabrada123 959bbac9bd Fix nested task issues 2023-05-13 09:47:12 +02:00
kozabrada123 cef8fe9fdb Deserialization error.. 2023-05-13 09:05:20 +02:00
kozabrada123 28e956e969 Merge branch 'polyphony-chat:main' into main 2023-05-13 06:11:07 +00:00
bitfl0wer 4abe3d87ec Change visibility of attachments 2023-05-12 19:18:51 +02:00
bitfl0wer ec37e89cc4 add set_id() to FileAttachment
This is so that the id of the Attachment to be sent can just be overwritten by the send() method.
2023-05-12 19:18:40 +02:00
bitfl0wer 1d2ebdd3cd Make attachment sending work! 2023-05-12 19:18:00 +02:00
kozabrada123 94fabbffb0 Merge branch 'polyphony-chat:main' into main 2023-05-12 11:41:53 +00:00
bitfl0wer 32f337015a cargo fix 2023-05-12 12:35:06 +02:00
bitfl0wer 56be2c9a17 Change send to no longer take static refs 2023-05-12 12:34:27 +02:00
bitfl0wer 9fd3f733f7 Mark unused var as unused 2023-05-12 12:34:00 +02:00
bitfl0wer 6732640f96 impl PartialDiscordFileAttachment
Now contains move_$ methods, which can move individual values out of the PartialDiscordFileAttachment while preserving the rest of the object.
2023-05-12 12:33:39 +02:00
bitfl0wer c544bd409d work on implementing message attachment sending 2023-05-11 23:35:36 +02:00
kozabrada123 6dfaa6e91f Attempted reimpl 2023-05-11 22:47:31 +02:00
bitfl0wer ce46452a2f change message send impl 2023-05-11 22:36:35 +02:00
bitfl0wer a2819c13f0 add a todo so i dont forget to not eat all ram 2023-05-11 00:07:45 +02:00
bitfl0wer fe63d11055 cool i have written a memory hog 2023-05-11 00:06:13 +02:00
bitfl0wer 7387053998 Change imports 2023-05-10 18:44:17 +02:00
bitfl0wer 5a7d5e0a4c Change register test 2023-05-10 18:44:10 +02:00
kozabrada123 6ce7396275 Merge branch 'feature/gateway-observer' into main 2023-05-09 18:35:53 +00:00
bitfl0wer 3011b1164f Change test_registration 2023-05-09 19:30:52 +02:00
bitfl0wer 1bc8081655 Make register and login return UserObject 2023-05-09 17:19:41 +02:00
bitfl0wer e6291bf384 Extend UserObject to match with Spacebars' User 2023-05-09 17:19:23 +02:00
bitfl0wer aaf454ffa7 remove println 2023-05-09 17:19:04 +02:00
bitfl0wer a7514a28c6 impl get_settings() 2023-05-09 14:05:36 +02:00
bitfl0wer f06b43a8fe Make register and login return User 2023-05-09 14:05:03 +02:00
bitfl0wer b199d11889 Made modules public, removed 110 warnings 2023-05-09 14:04:46 +02:00
bitfl0wer c073d6be54 Removed empty lines of code 2023-05-09 14:04:34 +02:00
bitfl0wer f59f705ec0 make token pub 2023-05-09 13:10:07 +02:00
kozabrada123 fa05680552 Less spam debug log 2023-05-07 12:44:11 +02:00
bitfl0wer 40b7064541 Remove logged_in from User 2023-05-07 12:42:52 +02:00
bitfl0wer 31407c1bf1 Run clippy 2023-05-07 12:41:14 +02:00
bitfl0wer 6a94d34bb5 Remove unneccessary imports 2023-05-07 12:39:56 +02:00
bitfl0wer 240882ffdf Remove lifetime from Instance (see below)
Originally, it was planned, that the Instance object would store Users. I have identified, that this was not needed, as it goes beyond the scope of a library; Users of this library are expected to keep track of users themselves. The removal of this user storage also prevented further overcomplications.
2023-05-07 12:39:04 +02:00
kozabrada123 e67acfab49 Was still a merge conflict there 2023-05-07 12:05:58 +02:00