Skip to content
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: 2 additions & 2 deletions src/components/InvitePeopleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function addInvitee(invitee: string) {
}

// Convert email to NDN name
const ndnName = utils.convertEmailToNameLegacy(entry);
const ndnName = utils.convertEmailToName(entry);

// Form profile
new_profile = { name: ndnName, email: entry };
Expand Down Expand Up @@ -354,7 +354,7 @@ function addRequest(invitee: string) {
}

// Convert email to NDN name
const ndnName = utils.convertEmailToNameLegacy(entry);
const ndnName = utils.convertEmailToName(entry);

// Form profile
new_profile = { name: ndnName, email: entry };
Expand Down
7 changes: 1 addition & 6 deletions src/utils/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ export function convertEmailToName(email: string): string {
throw new Error('Invalid email address');
}

const parts = email.toLowerCase().split('@');
const user = parts[0];
const domain = parts[1];

// Technically @ is not allowed in URI, but NDNd can handle this
return `/${domain}/@${user}`;
return encodeURIComponent(email.toLowerCase());
}

export function convertEmailToNameLegacy(email: string): string {
Expand Down
Loading