Skip to content

Commit

Permalink
chore(deps): update all (major) (#19)
Browse files Browse the repository at this point in the history
* chore(deps): update all

* fix: update mongodb

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Infiniwave <[email protected]>
  • Loading branch information
renovate[bot] and infiniwave authored Aug 13, 2024
1 parent 5f00151 commit 8cdad39
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: upgrade
run: rustup override set nightly
- name: nightly-clippy
Expand Down
90 changes: 42 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async-std = { version = "1.12.0", features = ["attributes", "tokio1"] }
async-trait = "0.1.73"
futures-util = "0.3.28"

dashmap = "5.5.0"
dashmap = "6.0.0"
lazy_static = "1.4.0"
once_cell = "1.18.0"

Expand All @@ -24,8 +24,8 @@ log = "0.4.20"

async-tungstenite = "0.27.0"

mongodb = "2.6.0"
jsonwebtoken = "8.3.0"
mongodb = "3.0.0"
jsonwebtoken = "9.0.0"
redis = { version = "0.26.0", features = ["async-std-comp"] }

serde = { version = "1.0.183", features = ["derive"] }
Expand Down
3 changes: 1 addition & 2 deletions src/services/database/calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Call {
let database = super::get_database();
database
.collection::<Call>("calls")
.insert_one(self.clone(), None)
.insert_one(self.clone())
.await?;
Ok(())
}
Expand All @@ -39,7 +39,6 @@ impl Call {
"ended_at": chrono::Utc::now().timestamp_millis(),
},
},
None,
)
.await?;
Ok(())
Expand Down
12 changes: 5 additions & 7 deletions src/services/database/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ impl Channel {
let database = super::get_database();
let channel = database
.collection::<Channel>("channels")
.find_one(
doc! {
"id": id,
},
None,
)
.find_one(doc! {
"id": id,
})
.await?;
match channel {
Some(channel) => Ok(channel),
Expand Down Expand Up @@ -94,7 +91,8 @@ impl Channel {
.build();
let messages: Vec<_> = database
.collection::<Message>("messages")
.find(query, options)
.find(query)
.with_options(options)
.await?
.collect()
.await;
Expand Down
9 changes: 3 additions & 6 deletions src/services/database/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ pub async fn get_event(event_id: String) -> Result<Event> {
let database = super::get_database();
let event = database
.collection::<Event>("events")
.find_one(
doc! {
"id": event_id,
},
None,
)
.find_one(doc! {
"id": event_id,
})
.await?;
match event {
Some(event) => Ok(event),
Expand Down
30 changes: 12 additions & 18 deletions src/services/database/infractions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub async fn create_ban(
};
database
.collection::<Infraction>("infraction")
.insert_one(ban, None)
.insert_one(ban)
.await?;
Ok(())
}
Expand All @@ -54,17 +54,14 @@ pub async fn is_banned(user_id: String, space_id: String) -> Result<bool> {
let database = super::get_database();
let bans = database
.collection::<Infraction>("infractions")
.find(
doc! {
"member_id": user_id,
"space_id": space_id,
"expires_at": {
"$gt": chrono::Utc::now().timestamp_millis()
},
"infraction_type": "BAN"
.find(doc! {
"member_id": user_id,
"space_id": space_id,
"expires_at": {
"$gt": chrono::Utc::now().timestamp_millis()
},
None,
)
"infraction_type": "BAN"
})
.await?;
let is_banned = bans.count().await > 0;
Ok(is_banned)
Expand All @@ -74,13 +71,10 @@ pub async fn revoke_ban(ban_id: String) -> Result<()> {
let database = super::get_database();
database
.collection::<Infraction>("infractions")
.delete_one(
doc! {
"id": ban_id,
"infraction_type": "BAN"
},
None,
)
.delete_one(doc! {
"id": ban_id,
"infraction_type": "BAN"
})
.await?;
Ok(())
}
Loading

0 comments on commit 8cdad39

Please sign in to comment.