Skip to content

Commit

Permalink
chore: Remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
nesium committed Apr 10, 2024
1 parent 80b581b commit cb201fa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use anyhow::Result;
use async_trait::async_trait;
use chrono::Local;

use prose_proc_macros::InjectDependencies;

Expand Down Expand Up @@ -53,7 +54,7 @@ impl RequestsEventHandler {
.respond_to_entity_time_request(
&event.sender_id,
&event.request_id,
&self.time_provider.now().into(),
&self.time_provider.now().with_timezone(&Local).into(),
)
.await?;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use anyhow::Result;
use async_trait::async_trait;
use chrono::{DateTime, Local};
use chrono::{DateTime, FixedOffset};

use prose_wasm_utils::{SendUnlessWasm, SyncUnlessWasm};

Expand All @@ -29,7 +29,7 @@ pub trait RequestHandlingService: SendUnlessWasm + SyncUnlessWasm {
&self,
to: &SenderId,
id: &RequestId,
now: &DateTime<Local>,
now: &DateTime<FixedOffset>,
) -> Result<()>;

async fn respond_to_software_version_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use std::fmt::{Display, Formatter};

use async_trait::async_trait;
use chrono::{DateTime, Local, Utc};
use chrono::{DateTime, FixedOffset};
use xmpp_parsers::version::VersionResult;

use prose_xmpp::mods;
Expand Down Expand Up @@ -45,11 +45,11 @@ impl RequestHandlingService for XMPPClient {
&self,
to: &SenderId,
id: &RequestId,
now: &DateTime<Local>,
now: &DateTime<FixedOffset>,
) -> anyhow::Result<()> {
let profile = self.client.get_mod::<mods::Profile>();
profile
.send_entity_time_response(now.clone().into(), to.clone().into_inner(), id.as_ref())
.send_entity_time_response(now.clone(), to.clone().into_inner(), id.as_ref())
.await?;
Ok(())
}
Expand Down
8 changes: 6 additions & 2 deletions crates/prose-core-client/tests/requests_event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use std::sync::Arc;

use anyhow::Result;
use chrono::{TimeZone, Utc};
use chrono::{FixedOffset, TimeZone, Utc};
use mockall::predicate;

use prose_core_client::app::event_handlers::{
Expand Down Expand Up @@ -55,7 +55,11 @@ async fn test_handles_entity_time_query() -> Result<()> {
.with(
predicate::eq(sender_id!("sender@prose.org")),
predicate::eq(RequestId::from("my-request")),
predicate::eq(Utc.with_ymd_and_hms(2023, 09, 10, 0, 0, 0).unwrap()),
predicate::eq(
Utc.with_ymd_and_hms(2023, 09, 10, 0, 0, 0)
.unwrap()
.with_timezone(&FixedOffset::east_opt(0).unwrap()),
),
)
.return_once(|_, _, _| Box::pin(async { Ok(()) }));

Expand Down

0 comments on commit cb201fa

Please sign in to comment.