Skip to content

Commit

Permalink
feat(analytics): adding identity sender field instead of the same_sen…
Browse files Browse the repository at this point in the history
…der (#881)
  • Loading branch information
geekbrother authored Dec 27, 2024
1 parent 5c30faa commit e34b30e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/analytics/identity_lookup_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ pub struct IdentityLookupInfo {
pub continent: Option<Arc<str>>,

pub client_id: Option<String>,
/// Whether the sender of the request is the same as the address being looked up
pub same_sender: Option<bool>,
pub sender: Option<String>,
}

impl IdentityLookupInfo {
Expand All @@ -46,7 +45,7 @@ impl IdentityLookupInfo {
country: Option<Arc<str>>,
continent: Option<Arc<str>>,
client_id: Option<String>,
same_sender: Option<bool>,
sender: Option<String>,
) -> Self {
Self {
timestamp: wc::analytics::time::now(),
Expand All @@ -68,7 +67,7 @@ impl IdentityLookupInfo {
continent,

client_id,
same_sender,
sender,
}
}
}
7 changes: 1 addition & 6 deletions src/handlers/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ async fn handler_internal(
.map(|geo| (geo.country, geo.continent, geo.region))
.unwrap_or((None, None, None));

let same_sender = query
.sender
.as_ref()
.map(|sender| sender == &address.to_string());

state.analytics.identity_lookup(IdentityLookupInfo::new(
&query.0,
address,
Expand All @@ -141,7 +136,7 @@ async fn handler_internal(
country,
continent,
query.client_id.clone(),
same_sender,
query.sender.clone(),
));
}

Expand Down

0 comments on commit e34b30e

Please sign in to comment.