Skip to content

Commit

Permalink
Don't show incorrect mail address info on legacy plans
Browse files Browse the repository at this point in the history
It is not true that legacy plans can have unlimited custom domains. Make
it not display anything here to prevent confusion.

Fixes #6540
  • Loading branch information
paw-hub authored and charlag committed Feb 26, 2024
1 parent 00c2c7f commit 7930e70
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/misc/TranslationKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1625,3 +1625,4 @@ export type TranslationKeyType =
| "yourMessage_label"
| "you_label"
| "emptyString_msg"
| "mailAddressInfoLegacy_msg"
2 changes: 1 addition & 1 deletion src/settings/mailaddress/MailAddressTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class MailAddressTable implements Component<MailAddressTableAttrs> {
"{totalAmount}": model.aliasCount.totalAliases,
}),
),
m(".small.mt-s", lang.get("mailAddressInfo_msg")),
m(".small.mt-s", lang.get(model.aliasLimitIncludesCustomDomains() ? "mailAddressInfoLegacy_msg" : "mailAddressInfo_msg")),
]
: null,
]
Expand Down
10 changes: 10 additions & 0 deletions src/settings/mailaddress/MailAddressTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@ export interface MailAddressNameChanger {
/** Model for showing the list of mail addresses and optionally adding more, enabling/disabling/setting names for them. */
export class MailAddressTableModel {
private nameMappings: AddressToName | null = null
private onLegacyPlan: boolean = false
aliasCount: MailAddressAliasServiceReturn | null = null

init: () => Promise<void> = lazyMemoized(async () => {
this.eventController.addEntityListener(this.entityEventsReceived)

// important: "not on legacy plan" is true for free plans
const userController = this.logins.getUserController()
this.onLegacyPlan = userController.isLegacyPlan(await userController.getPlanType())

await this.loadNames()
this.redraw()
await this.loadAliasCount()
Expand All @@ -72,6 +78,10 @@ export class MailAddressTableModel {
return this.logins.getUserController().isGlobalAdmin()
}

aliasLimitIncludesCustomDomains(): boolean {
return this.onLegacyPlan
}

addresses(): AddressInfo[] {
const { nameMappings } = this
if (nameMappings == null) {
Expand Down
3 changes: 2 additions & 1 deletion src/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ export default {
"yourCalendars_label": "Deine Kalender",
"yourFolders_action": "DEINE ORDNER",
"yourMessage_label": "Deine Nachricht",
"you_label": "Du"
"you_label": "Du",
"mailAddressInfoLegacy_msg": "Deaktivierte E-Mail-Adressen können einer anderen Mailbox innerhalb deines Kontos zugewiesen werden."
}
}
3 changes: 2 additions & 1 deletion src/translations/de_sie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ export default {
"yourCalendars_label": "Deine Kalender",
"yourFolders_action": "Ihre ORDNER",
"yourMessage_label": "Ihre Nachricht",
"you_label": "Sie"
"you_label": "Sie",
"mailAddressInfoLegacy_msg": "Deaktivierte E-Mail-Adressen können einer anderen Mailbox innerhalb Ihres Kontos zugewiesen werden."
}
}
3 changes: 2 additions & 1 deletion src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,7 @@ export default {
"yourCalendars_label": "Your calendars",
"yourFolders_action": "YOUR FOLDERS",
"yourMessage_label": "Your message",
"you_label": "You"
"you_label": "You",
"mailAddressInfoLegacy_msg": "Disabled email addresses can be reassigned to another user or mailbox within your account."
}
}

0 comments on commit 7930e70

Please sign in to comment.