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 murilopereirame committed Mar 1, 2024
1 parent 8c75d32 commit 5a9dd6a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/misc/TranslationKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,7 @@ export type TranslationKeyType =
| "yourMessage_label"
| "you_label"
| "emptyString_msg"
| "mailAddressInfoLegacy_msg"
| "vcardInSharingFiles_msg"
| "importFromContactBook_label"
| "importContacts_label"
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
1 change: 1 addition & 0 deletions src/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,7 @@ export default {
"yourFolders_action": "DEINE ORDNER",
"yourMessage_label": "Deine Nachricht",
"you_label": "Du",
"mailAddressInfoLegacy_msg": "Deaktivierte E-Mail-Adressen können einer anderen Mailbox innerhalb deines Kontos zugewiesen werden.",
"vcardInSharingFiles_msg": "Wir haben eine oder mehrere Kontaktdateien entdeckt. Möchtest Du diese importieren oder anhängen?",
"importFromContactBook_label": "Kontakte von deinem Gerät importieren",
"importContacts_label": "Kontakte importieren"
Expand Down
1 change: 1 addition & 0 deletions src/translations/de_sie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,7 @@ export default {
"yourFolders_action": "Ihre ORDNER",
"yourMessage_label": "Ihre Nachricht",
"you_label": "Sie",
"mailAddressInfoLegacy_msg": "Deaktivierte E-Mail-Adressen können einer anderen Mailbox innerhalb Ihres Kontos zugewiesen werden.",
"vcardInSharingFiles_msg": "Wir haben eine oder mehrere Kontaktdateien entdeckt. Möchten Sie diese importieren oder anhängen?",
"importFromContactBook_label": "Kontakte von Ihrem Gerät importieren",
"importContacts_label": "Kontakte importieren"
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,7 @@ export default {
"yourFolders_action": "YOUR FOLDERS",
"yourMessage_label": "Your message",
"you_label": "You",
"mailAddressInfoLegacy_msg": "Disabled email addresses can be reassigned to another user or mailbox within your account.",
"vcardInSharingFiles_msg": "We detected one or more contact files, do you want to import or attach them?",
"importFromContactBook_label": "Import contacts from your device",
"importContacts_label": "Import contacts"
Expand Down

0 comments on commit 5a9dd6a

Please sign in to comment.