Skip to content

Commit 47ed444

Browse files
authored
Merge pull request #112 from a-thieme/naming-convention-update
email conversion updated to single name component
2 parents 581ea17 + 5b9dd01 commit 47ed444

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎src/components/InvitePeopleModal.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function addInvitee(invitee: string) {
311311
}
312312
313313
// Convert email to NDN name
314-
const ndnName = utils.convertEmailToNameLegacy(entry);
314+
const ndnName = utils.convertEmailToName(entry);
315315
316316
// Form profile
317317
new_profile = { name: ndnName, email: entry };
@@ -354,7 +354,7 @@ function addRequest(invitee: string) {
354354
}
355355
356356
// Convert email to NDN name
357-
const ndnName = utils.convertEmailToNameLegacy(entry);
357+
const ndnName = utils.convertEmailToName(entry);
358358
359359
// Form profile
360360
new_profile = { name: ndnName, email: entry };

‎src/utils/email.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ export function convertEmailToName(email: string): string {
1616
throw new Error('Invalid email address');
1717
}
1818

19-
const parts = email.toLowerCase().split('@');
20-
const user = parts[0];
21-
const domain = parts[1];
22-
23-
// Technically @ is not allowed in URI, but NDNd can handle this
24-
return `/${domain}/@${user}`;
19+
return encodeURIComponent(email.toLowerCase());
2520
}
2621

2722
export function convertEmailToNameLegacy(email: string): string {

0 commit comments

Comments
 (0)