Commit Graph

124 Commits

Author SHA1 Message Date
Flori 06f3046134 initial wasm32 'support' (#443)
* Give tungstenite types distinct names

* reorganize files

* Better feature locking, add wasm.rs

* Implement wasm Backend

* add wasm-bindgen-test

* Build & Test for wasm

* Add macos safari wasm test

* Add wasm32 target

* Add wasm.rs test

* Move wasm-pack installation before test execution

* Fix build on wasm32

* Fix examples depending on tokio::time

* fix clippy warn

* Add example wasm bindgen test

* Add wasm-bindgen to Cargo.toml

* Add wasm test configuration

* Install wasm-bindgen-cli on linux

* Add  wasm-bindgen-cli to macos

* Correct "vers" to "version"

* Attempt to locate correct geckodriver

* Run wasm tests first

* maybe this will fix ci :clueless:

* Move wasm-bindgen-cli install

* Add cargo-binstall installation script for
wasm-bindgen-cli

* Try using only one browser

* remove geckodriver

* Move all wasm related tests to macos

* Rename macOS test step for clarity

* Try out combined coverage report

* try different strategy to skip coverage on forks

* Revert "try different strategy to skip coverage on forks"

This reverts commit fb46ab83ac.

* Revert "Try out combined coverage report"

This reverts commit d34a813d8a.
2023-11-20 13:40:55 +01:00
bitfl0wer a4d5ebb689 Resolve merge conflicts 2023-11-19 19:12:29 +01:00
bitfl0wer 862a846055 Rename `get_handle` to `spawn` 2023-11-18 19:07:56 +01:00
bitfl0wer 16bdd68d98 Fixed most errors, simplified new generic traits 2023-11-18 18:39:01 +01:00
bitfl0wer 5bbf1cef1f Add prefix "Default" To Gateway, -Handler and HeartbeatHandler 2023-11-15 20:58:10 +01:00
bitfl0wer 5af6d1ce4b Refactor Gateway module to implement traits and
improve code structure
2023-11-15 18:44:19 +01:00
bitfl0wer c6fa385e28 Fix auth 2023-09-01 15:02:44 +02:00
bitfl0wer e17fcd9e0f Make login only take owned values 2023-09-01 13:01:50 +02:00
bitfl0wer a8bcb58493 Make auth functions take owned values, similar to the rest of the API 2023-09-01 12:12:07 +02:00
kozabrada123 3d8d6b6f3b Make GatewayHandle Clone 2023-08-29 14:24:32 +02:00
bitfl0wer 17fe4f004f Make ChorusUser `Clone` 2023-08-29 00:05:16 +02:00
bitfl0wer aee50036a0 Add delete_role + test 2023-08-26 16:54:24 +02:00
bitfl0wer c53ec53412 Add kick member spell 2023-08-26 16:22:47 +02:00
bitfl0wer 07ebaf6119 Add Get Guild Ban/s, add audit_log_reason to create_ban 2023-08-25 17:26:01 +02:00
bitfl0wer d73c1963fc Start refactoring ChorusRequest to ChorusRequest::new() 2023-08-25 00:02:26 +02:00
bitfl0wer fb7e33c0ec Change `UserMeta` to `ChorusUser` 2023-08-24 21:06:28 +02:00
bitfl0wer 7b5426519d Closes #269, #268, #270 2023-08-22 20:09:44 +02:00
bitfl0wer 71dc645210 Add search_messages Test 2023-08-22 19:23:05 +02:00
bitfl0wer 9ac5925bf9 Make channel_type in ChannelCreateSchema of type enum "ChannelType" 2023-08-22 17:55:29 +02:00
bitfl0wer 29d5fe947c Add modify_guild test 2023-08-20 23:24:06 +02:00
bitfl0wer 99fed46225 Make ban test a little more meaningful 2023-08-20 19:26:00 +02:00
bitfl0wer 1f6b221413 Add "lazy" test for guild_create_ban 2023-08-20 18:55:47 +02:00
bitfl0wer adf3d4ef31 Update test a little 2023-08-17 18:23:57 +02:00
bitfl0wer 7c8ad3ffcf Rewrite recursive update test (still fails sob) 2023-08-16 22:04:24 +02:00
bitfl0wer fbf72b74d0 Remove tokio watch channels 2023-08-16 21:26:19 +02:00
bitfl0wer e9f94267c6 Add recursive-updating-structs test 2023-08-16 14:06:04 +02:00
bitfl0wer e0340047fb Remove import 2023-08-16 01:11:48 +02:00
bitfl0wer e43fe061b3 Refactor test 2023-08-16 01:11:32 +02:00
bitfl0wer a9381fec1e Revert "Give `GatewayHandle` and `Gateway` common trait to call `watch_whole()` or observe() from a `Gateway`"
This reverts commit d36b1de170.
2023-08-16 00:21:18 +02:00
bitfl0wer d36b1de170 Give `GatewayHandle` and `Gateway` common trait to call `watch_whole()` or observe() from a `Gateway` 2023-08-16 00:18:32 +02:00
bitfl0wer b1594cf1e1 Merge branch 'feature/update-message-all-events' into enhancement/improved-auto-updating-structs 2023-08-15 20:53:56 +02:00
bitfl0wer 2fd1a7e7f4 Remove unused import 2023-08-15 20:30:30 +02:00
bitfl0wer c03b250248 Clean up test 2023-08-15 20:20:58 +02:00
bitfl0wer c3be91667b Try calling new method to see if it panics 2023-08-15 17:54:48 +02:00
bitfl0wer c0c873d460 Update test to match code changes 2023-08-13 16:44:58 +02:00
bitfl0wer 20cd457c04 Change tests to deal with `Arc<RwLock<T>>`'s 2023-08-13 15:54:07 +02:00
bitfl0wer 73cc139e78 Moddify observe to still store T internally 2023-08-13 15:52:16 +02:00
fowb 29d4ef23a2 Change T: Updateable to Arc<RwLock<T>> 2023-08-12 22:40:40 +02:00
fowb a0c9f6fb14 Change observe() to take Arc<RwLock<T>> 2023-08-12 19:47:11 +02:00
fowb ff47965e99 Change Mutex<T> to RwLock<T> 2023-08-12 19:31:31 +02:00
bitfl0wer dad419c1de update mutex to rwlock 2023-08-04 20:08:49 +02:00
bitfl0wer 98188eadc4 Fix deadlock on test_get_mutual_relationships 2023-08-04 11:42:28 +02:00
bitfl0wer 420c2f7727 Fix deadlock in test_get_relationships 2023-08-04 11:34:03 +02:00
bitfl0wer fb792f8356 Integrate component behaviour everywhere 2023-08-04 11:19:23 +02:00
kozabrada123 8b76936050 Fix the test 2023-07-30 09:10:32 +02:00
kozabrada123 83d4ffc4e8 Moar docs 2023-07-29 10:23:04 +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
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
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