Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated recurring field #6077

Merged
merged 2 commits into from
Jul 19, 2024
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
4 changes: 4 additions & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Accept proofs of uniqueness from LocalUserIndexes ([#6068](https://github.com/open-chat-labs/open-chat/pull/6068))
- Ensure UserIndex is only controller before installing LocalUserIndex ([#6070](https://github.com/open-chat-labs/open-chat/pull/6070))

### Removed

- Remove deprecated `recurring` field ([#6077](https://github.com/open-chat-labs/open-chat/pull/6077))

## [[2.0.1242](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1242-user_index)] - 2024-07-17

### Added
Expand Down
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
Loading