mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
avoid promising referral rewards
This commit is contained in:
@@ -179,7 +179,7 @@ impl ReferralClient {
|
||||
let description = eligibility
|
||||
.description
|
||||
.clone()
|
||||
.unwrap_or_else(|| fallback_description(&eligibility));
|
||||
.unwrap_or_else(|| "Invite someone to Codex. Rewards may apply.".to_string());
|
||||
|
||||
Ok(Some(ReferralOffer {
|
||||
description,
|
||||
@@ -317,29 +317,3 @@ fn preflight_failure(message: impl Into<String>) -> anyhow::Error {
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
fn fallback_description(eligibility: &EligibilityResponse) -> String {
|
||||
match (&eligibility.grant_amount, &eligibility.grant_action) {
|
||||
(Some(amount), Some(action)) => format!(
|
||||
"Invite someone and earn {} {}.",
|
||||
reward_value_to_string(amount),
|
||||
reward_value_to_string(action)
|
||||
),
|
||||
(Some(amount), None) => format!(
|
||||
"Invite someone and earn a Codex reward worth {}.",
|
||||
reward_value_to_string(amount)
|
||||
),
|
||||
(None, Some(action)) => format!(
|
||||
"Invite someone and earn a Codex {} reward.",
|
||||
reward_value_to_string(action)
|
||||
),
|
||||
(None, None) => "Invite someone and earn a Codex reward.".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn reward_value_to_string(value: &Value) -> String {
|
||||
value
|
||||
.as_str()
|
||||
.map(str::to_string)
|
||||
.unwrap_or_else(|| value.to_string())
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ expression: "render_bottom_popup(&chat, 80)"
|
||||
|
||||
› 1. Show usage View recent account token usage.
|
||||
2. Redeem usage limit reset Check reset availability.
|
||||
3. Invite someone to Codex Invite a friend and earn a usage reset.
|
||||
3. Invite someone to Codex Invite someone to Codex. Rewards may apply.
|
||||
|
||||
Press enter to confirm or esc to go back
|
||||
|
||||
@@ -173,7 +173,7 @@ async fn changed_referral_offer_requires_reconfirmation_before_send() {
|
||||
|
||||
fn test_offer() -> ReferralOffer {
|
||||
ReferralOffer {
|
||||
description: "Invite a friend and earn a usage reset.".to_string(),
|
||||
description: "Invite someone to Codex. Rewards may apply.".to_string(),
|
||||
rules: vec!["Your friend must be new to Codex.".to_string()],
|
||||
grant_action: Some(serde_json::json!("usage_reset")),
|
||||
grant_amount: Some(serde_json::json!(1)),
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ EMAIL
|
||||
Press enter to confirm or esc to go back
|
||||
CONFIRMATION
|
||||
Send referral invite?
|
||||
Invite a friend and earn a usage reset.
|
||||
Invite someone to Codex. Rewards may apply.
|
||||
Recipient: friend@example.com
|
||||
• Your friend must be new to Codex.
|
||||
By sending, you confirm that you have this
|
||||
|
||||
Reference in New Issue
Block a user