Commit Graph

1192 Commits

Author SHA1 Message Date
bitfl0wer 3d3c61240c pub use 2023-11-18 12:27:50 +01:00
bitfl0wer db80abbf43 Make heartbeathandler shared struct 2023-11-16 20:02:01 +01:00
bitfl0wer cefaa6545f Remove duplicate code 2023-11-16 19:25:55 +01:00
bitfl0wer 339a8f5b7c Revert "Add Adapter GatewayMessageData"
This reverts commit f355837125.
2023-11-16 19:07:14 +01:00
bitfl0wer e38445b644 Revert "Make GatewayMessage use new Adapter Type"
This reverts commit b0b90f094e.
2023-11-16 19:05:36 +01:00
bitfl0wer b0b90f094e Make GatewayMessage use new Adapter Type 2023-11-16 18:30:09 +01:00
bitfl0wer f355837125 Add Adapter GatewayMessageData
Fits onto tokio_tungstenite Messages and ws_stream_wasm::WsMessage
2023-11-16 18:20:45 +01:00
bitfl0wer 6106ac41ae Add import 2023-11-16 18:20:11 +01:00
bitfl0wer f8795adc35 Make message.rs shared
Make HeartbeatThreadCommunication shared

Move shared code to mod.rs

Export new shared code

Remove useless export
2023-11-16 17:50:04 +01:00
bitfl0wer b27f60b989 Move ws_stream_wasm to shared dependencies
Avoids conditional compiling bug i haven't yet fully found out. See:
https://cloud.bitfl0wer.de/s/KEcZs7PtQ3JZo8x
2023-11-16 16:28:55 +01:00
bitfl0wer 1fdb01e846 Move events to shared location 2023-11-16 16:24:25 +01:00
bitfl0wer 739f2c8b71 Create wasm gateway module 2023-11-16 16:24:02 +01:00
bitfl0wer e9bf3b32a0 Move heartbeat to shared location 2023-11-16 16:23:44 +01:00
bitfl0wer 14fa9a929c Add wasm gateway submodule 2023-11-15 22:32:31 +01:00
bitfl0wer d328dcf314 Conditionally compile wasm/default 2023-11-15 22:32:13 +01:00
bitfl0wer b84d4519b7 Change typedef to only compile with feature client 2023-11-15 22:31:44 +01:00
bitfl0wer 5ae0521e8e re-organize files 2023-11-15 22:26:15 +01:00
bitfl0wer 10eafe46cc Feature lock DefaultGateway+Handle for non-wasm32 2023-11-15 21:09:24 +01:00
bitfl0wer b93b3690da Refactor project to use chorus::Gateway[...] 2023-11-15 21:03:53 +01:00
bitfl0wer 5bbf1cef1f Add prefix "Default" To Gateway, -Handler and HeartbeatHandler 2023-11-15 20:58:10 +01:00
bitfl0wer e4cc201b79 Remove all imports of Gateway and GatewayHandle 2023-11-15 20:57:06 +01:00
bitfl0wer 9ac36ab8e8 Fix clippy warning 2023-11-15 20:26:47 +01:00
bitfl0wer 20c9066e6f Properly extract all extractable methods from GatewayHandle into Trait 2023-11-15 20:18:50 +01:00
bitfl0wer 5af6d1ce4b Refactor Gateway module to implement traits and
improve code structure
2023-11-15 18:44:19 +01:00
bitfl0wer 06d25d3e50 Impl base of GatewayCapable for Gateway 2023-11-15 00:04:04 +01:00
bitfl0wer 1128502b80 start converting struct impl into trait impl 2023-11-14 21:14:05 +01:00
bitfl0wer ee0169c648 Add missing, least required methods to traitdef 2023-11-14 20:46:46 +01:00
bitfl0wer 2cb35f2f14 Start impl of Gateway Traits 2023-11-14 20:05:47 +01:00
bitfl0wer 03d3c0b112 Use GatewayStore instead of complex typedef 2023-11-14 20:05:21 +01:00
bitfl0wer 199bf91daf Factor out GatewayStore into own type 2023-11-14 20:04:23 +01:00
bitfl0wer 99eb869878 Remove unneeded import 2023-11-14 19:00:43 +01:00
bitfl0wer a67c54168b Merge branch 'dev' into feature/wasm32-unknown 2023-11-14 19:00:20 +01:00
Flori c23c07a262 Fix: #430 (#440)
Fixes #430
2023-11-14 17:59:53 +01:00
bitfl0wer b4193e2c2e Make id Optional, custom impl Updateable 2023-11-14 17:31:07 +01:00
kozabrada123 2bff2cb8cf fix: Voice State session id is a string, not a snowflake 2023-11-14 17:08:46 +01:00
bitfl0wer 2ee421d57e Generate snowflake if not exists 2023-11-14 16:55:23 +01:00
bitfl0wer 572a586505 I fucked up the merge and merged gateway wrongly 2023-11-14 16:42:01 +01:00
bitfl0wer bdfc261c93 Merge branch 'main' into feature/wasm32-unknown 2023-11-14 16:30:24 +01:00
bitfl0wer 7d8e980cc2 bump version 2023-11-14 16:11:00 +01:00
bitfl0wer 1caf8e9ba2 bump version 2023-11-14 16:10:37 +01:00
Flori 26bab1d12e Several small patches (#439)
- Bump versions of 2 packages to mitigate security vulnerabilities
- Remove redundant structdef
- Split up gateway.rs into multiple files for better clarity
2023-11-14 16:09:25 +01:00
Flori e055d8f04c Bump version 2023-11-14 16:02:51 +01:00
Flori 08b663c114 Split up gateway, fix a few clippy warnings (#436)
As the title suggests, `Gateway` has been split up into several files,
due to it being several hundred locs in length and, in my opinion,
becoming difficult/frustrating to navigate.

I have also fixed 2 clippy warnings: I have refactored an `if
x.is_some()... { x.unwrap() }` into the more idiomatic `if let Some(y) =
x ...`, and I have removed the duplicate definition of `NSFWLevel` in
`types/invite`.
2023-11-14 16:00:02 +01:00
bitfl0wer 32b163a4c7 Move HEARTBEAT_ACK_TIMEOUT
Delete events.rs

Unify import

Move HEARTBEAT_ACK_TIMEOUT since its not an OPCODE
2023-11-14 15:46:23 +01:00
Flori 512e26d9ec Bump rustix from 0.38.11 to 0.38.22 (#438)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.11
to 0.38.22.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="58238c794c"><code>58238c7</code></a>
chore: Release rustix version 0.38.22</li>
<li><a
href="ee297a1541"><code>ee297a1</code></a>
Miscellaneous clippy fixes. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/928">#928</a>)</li>
<li><a
href="b28c5a8308"><code>b28c5a8</code></a>
Miscellaneous documentation cleanups. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/929">#929</a>)</li>
<li><a
href="cc82ed28cc"><code>cc82ed2</code></a>
Fix ioctl numbers on BSDs (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/926">#926</a>)</li>
<li><a
href="90b2fbd818"><code>90b2fbd</code></a>
Add ioctl <code>Updater</code> type (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/925">#925</a>)</li>
<li><a
href="e1d66b5822"><code>e1d66b5</code></a>
Make <code>runtime::fork</code> return the PID in both the parent and
child. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/924">#924</a>)</li>
<li><a
href="31dfad159d"><code>31dfad1</code></a>
Fixes for empty and multiple-entry control message buffers. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/915">#915</a>)</li>
<li><a
href="1edcdfe02a"><code>1edcdfe</code></a>
Add a <code>readlinkat_raw</code> function. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/923">#923</a>)</li>
<li><a
href="15278a1279"><code>15278a1</code></a>
Implement <code>rustix::process::sched_getcpu</code>. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/921">#921</a>)</li>
<li><a
href="560b2e818a"><code>560b2e8</code></a>
Remove redundant checks for <code>linux_kernel</code> in the linux_raw
backend. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/922">#922</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/bytecodealliance/rustix/compare/v0.38.11...v0.38.22">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustix&package-manager=cargo&previous-version=0.38.11&new-version=0.38.22)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/polyphony-chat/chorus/network/alerts).

</details>
2023-11-14 12:46:16 +01:00
Flori 065b2d32e0 Bump tungstenite from 0.20.0 to 0.20.1 (#437)
Bumps [tungstenite](https://github.com/snapview/tungstenite-rs) from
0.20.0 to 0.20.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md">tungstenite's
changelog</a>.</em></p>
<blockquote>
<h1>0.20.1</h1>
<ul>
<li>Fixes <a
href="https://redirect.github.com/snapview/tungstenite-rs/pull/379">CVE-2023-43669</a>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="219075edaa"><code>219075e</code></a>
Merge pull request <a
href="https://redirect.github.com/snapview/tungstenite-rs/issues/379">#379</a>
from snapview/CVE-2023-43669</li>
<li><a
href="f0f1a06a50"><code>f0f1a06</code></a>
Bump crate version</li>
<li><a
href="2e5029284b"><code>2e50292</code></a>
Add checking for header sanity</li>
<li><a
href="f916b332a9"><code>f916b33</code></a>
Add <code>AttackAttempt</code> error variant</li>
<li><a
href="53914c1180"><code>53914c1</code></a>
Include examples so that <code>cargo publish</code> works</li>
<li><a
href="5323559891"><code>5323559</code></a>
Bump version</li>
<li>See full diff in <a
href="https://github.com/snapview/tungstenite-rs/compare/v0.20.0...v0.20.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tungstenite&package-manager=cargo&previous-version=0.20.0&new-version=0.20.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/polyphony-chat/chorus/network/alerts).

</details>
2023-11-14 12:41:29 +01:00
dependabot[bot] 318007d1e7 Bump rustix from 0.38.11 to 0.38.22
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.11 to 0.38.22.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.11...v0.38.22)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 11:35:55 +00:00
Flori 5e8fe3d24b Manually bump tungstenite to 0.20.1 in cargo.toml 2023-11-14 12:33:12 +01:00
dependabot[bot] 564f5cb270 Bump tungstenite from 0.20.0 to 0.20.1
Bumps [tungstenite](https://github.com/snapview/tungstenite-rs) from 0.20.0 to 0.20.1.
- [Changelog](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tungstenite-rs/compare/v0.20.0...v0.20.1)

---
updated-dependencies:
- dependency-name: tungstenite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 10:22:09 +00:00
bitfl0wer 5243eee256 Remove redundant `NSFWLevel` structdef 2023-11-14 11:13:21 +01:00