Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/features/contacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,7 @@ impl<'a> Contacts<'a> {
&& self
.client
.ab_props
.is_enabled_or(
wacore::iq::props::config_codes::PROFILE_PIC_PRIVACY_TOKEN,
true,
)
.is_enabled(wacore::iq::props::stale::PROFILE_PIC_PRIVACY_TOKEN)
.await
&& let Some(token) = self.client.lookup_tc_token_for_jid(jid).await
{
Expand Down
6 changes: 3 additions & 3 deletions src/features/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl<'a> Groups<'a> {
if self
.client
.ab_props()
.is_enabled(wacore::iq::props::config_codes::PRIVACY_TOKEN_ON_GROUP_CREATE)
.is_enabled(wacore::iq::abprops::web::PRIVACY_TOKEN_SENDING_ON_GROUP_CREATE)
.await
{
self.attach_tokens_to_participants(&mut options.participants)
Expand Down Expand Up @@ -422,7 +422,7 @@ impl<'a> Groups<'a> {
let iq = if self
.client
.ab_props()
.is_enabled(wacore::iq::props::config_codes::PRIVACY_TOKEN_ON_GROUP_PARTICIPANT_ADD)
.is_enabled(wacore::iq::abprops::web::PRIVACY_TOKEN_SENDING_ON_GROUP_PARTICIPANT_ADD)
.await
{
let options = self.resolve_participant_tokens(participants).await;
Expand Down Expand Up @@ -904,7 +904,7 @@ impl<'a> Groups<'a> {
async fn only_check_lid(&self) -> bool {
self.client
.ab_props()
.is_enabled(wacore::iq::props::config_codes::PRIVACY_TOKEN_ONLY_CHECK_LID)
.is_enabled(wacore::iq::props::stale::PRIVACY_TOKEN_ONLY_CHECK_LID)
.await
}

Expand Down
42 changes: 12 additions & 30 deletions src/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ impl Client {
to: &Jid,
extra_nodes: &mut Vec<Node>,
) -> (bool, Option<String>) {
use wacore::iq::props::config_codes;
use wacore::iq::abprops::web;
use wacore::iq::tctoken::{
build_cs_token_node, build_tc_token_node, compute_cs_token, is_tc_token_expired_with,
should_send_new_tc_token_with,
Expand Down Expand Up @@ -1779,7 +1779,7 @@ impl Client {
// AB prop gates stanza inclusion only (not issuance scheduling)
let token_send_enabled = self
.ab_props
.is_enabled_or(config_codes::PRIVACY_TOKEN_ON_ALL_1_ON_1_MESSAGES, false)
.is_enabled(web::PRIVACY_TOKEN_SENDING_ON_ALL_1_ON_1_MESSAGES)
.await;

if token_send_enabled {
Expand All @@ -1795,7 +1795,7 @@ impl Client {
// cstoken fallback — gated by wa_nct_token_send_enabled
let nct_send_enabled = self
.ab_props
.is_enabled_or(config_codes::NCT_TOKEN_SEND_ENABLED, false)
.is_enabled(web::WA_NCT_TOKEN_SEND_ENABLED)
.await;

if nct_send_enabled
Expand Down Expand Up @@ -2055,32 +2055,14 @@ impl Client {

/// Build tctoken timing config from AB props, falling back to defaults.
pub(crate) async fn tc_token_config(&self) -> wacore::iq::tctoken::TcTokenConfig {
use wacore::iq::props::config_codes;
use wacore::iq::tctoken::{TC_TOKEN_BUCKET_DURATION, TC_TOKEN_NUM_BUCKETS, TcTokenConfig};
use wacore::iq::abprops::web;
use wacore::iq::tctoken::TcTokenConfig;

TcTokenConfig {
bucket_duration: self
.ab_props
.get_int(config_codes::TCTOKEN_DURATION, TC_TOKEN_BUCKET_DURATION)
.await,
num_buckets: self
.ab_props
.get_int(config_codes::TCTOKEN_NUM_BUCKETS, TC_TOKEN_NUM_BUCKETS)
.await,
sender_bucket_duration: self
.ab_props
.get_int(
config_codes::TCTOKEN_DURATION_SENDER,
TC_TOKEN_BUCKET_DURATION,
)
.await,
sender_num_buckets: self
.ab_props
.get_int(
config_codes::TCTOKEN_NUM_BUCKETS_SENDER,
TC_TOKEN_NUM_BUCKETS,
)
.await,
bucket_duration: self.ab_props.get_int(web::TCTOKEN_DURATION).await,
num_buckets: self.ab_props.get_int(web::TCTOKEN_NUM_BUCKETS).await,
sender_bucket_duration: self.ab_props.get_int(web::TCTOKEN_DURATION_SENDER).await,
sender_num_buckets: self.ab_props.get_int(web::TCTOKEN_NUM_BUCKETS_SENDER).await,
}
.clamped()
}
Expand All @@ -2101,12 +2083,12 @@ impl Client {
/// Resolve the target JID for privacy token issuance.
/// Gated by `lid_trusted_token_issue_to_lid` — LID when true, PN when false.
async fn resolve_issuance_jid(&self, jid: &Jid) -> Jid {
use wacore::iq::props::config_codes;
use wacore::iq::abprops::web;

// Default true: issue to LID by default (safer — server accepts both)
// Matches the upstream default (false); the server overrides per-account.
let issue_to_lid = self
.ab_props
.is_enabled_or(config_codes::LID_TRUSTED_TOKEN_ISSUE_TO_LID, true)
.is_enabled(web::LID_TRUSTED_TOKEN_ISSUE_TO_LID)
Comment thread
jlucaso1 marked this conversation as resolved.
.await;

let resolved = if issue_to_lid {
Expand Down
Loading
Loading