Skip to content

Commit

Permalink
Remove deprecated recurring field
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Jul 19, 2024
1 parent c2fa7a8 commit 79edca3
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,22 @@ impl DiamondMembershipDetailsInternal {
.unwrap_or_default()
}

#[allow(deprecated)]
pub fn status_full(&self, now: TimestampMillis) -> DiamondMembershipStatusFull {
match self.expires_at {
Some(ts) if ts > LIFETIME_TIMESTAMP => DiamondMembershipStatusFull::Lifetime,
Some(ts) if ts > now => DiamondMembershipStatusFull::Active(DiamondMembershipDetails {
expires_at: ts,
pay_in_chat: self.pay_in_chat,
recurring: Some(self.subscription),
subscription: self.subscription,
}),
_ => DiamondMembershipStatusFull::Inactive,
}
}

#[allow(deprecated)]
pub fn hydrate(&self, now: TimestampMillis) -> Option<DiamondMembershipDetails> {
self.expires_at.filter(|&ts| now < ts).map(|ts| DiamondMembershipDetails {
expires_at: ts,
pay_in_chat: self.pay_in_chat,
recurring: self.subscription.is_active().then_some(self.subscription),
subscription: self.subscription,
})
}
Expand Down
1 change: 0 additions & 1 deletion backend/libraries/types/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,6 @@ type PrizeWinnerContent = record {

type DiamondMembershipDetails = record {
expires_at : TimestampMillis;
recurring : opt DiamondMembershipSubscription;
pay_in_chat : bool;
subscription : DiamondMembershipSubscription;
};
Expand Down
2 changes: 0 additions & 2 deletions backend/libraries/types/src/diamond_membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use std::fmt::{Display, Formatter};
pub struct DiamondMembershipDetails {
pub expires_at: TimestampMillis,
pub pay_in_chat: bool,
#[deprecated]
pub recurring: Option<DiamondMembershipSubscription>,
pub subscription: DiamondMembershipSubscription,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ export type DeletedMessageResponse = { 'UserNotInChannel' : null } |
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ export type DeletedMessageResponse = { 'MessageNotFound' : null } |
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ export interface DeletedGroupInfo {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ export type DeletedMessageResponse = { 'MessageNotFound' : null } |
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export type DiamondMembershipPlanDuration = { 'OneYear' : null } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const idlFactory = ({ IDL }) => {
const DiamondMembershipDetails = IDL.Record({
'pay_in_chat' : IDL.Bool,
'subscription' : DiamondMembershipSubscription,
'recurring' : IDL.Opt(DiamondMembershipSubscription),
'expires_at' : TimestampMillis,
});
const DiamondMembershipStatusFull = IDL.Variant({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ export interface DeletedContent {
export interface DiamondMembershipDetails {
'pay_in_chat' : boolean,
'subscription' : DiamondMembershipSubscription,
'recurring' : [] | [DiamondMembershipSubscription],
'expires_at' : TimestampMillis,
}
export interface DiamondMembershipFeesByDuration {
Expand Down

0 comments on commit 79edca3

Please sign in to comment.