mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 03:23:45 +08:00
[local-sync] Fix contact validation
Summary: Allow other fields to be passed in with participants, so that Contact objects can be passed in as JSON. Also fix an error check. Test Plan: tested locally Reviewers: jackie Reviewed By: jackie Differential Revision: https://phab.nylas.com/D3504
This commit is contained in:
parent
c214ba1e34
commit
138c79bf71
2 changed files with 4 additions and 1 deletions
|
@ -9,10 +9,13 @@ const SEND_TIMEOUT = 1000 * 60; // millliseconds
|
|||
const recipient = Joi.object().keys({
|
||||
name: Joi.string().required(),
|
||||
email: Joi.string().email().required(),
|
||||
// Rest are optional
|
||||
account_id: Joi.string(),
|
||||
client_id: Joi.string(),
|
||||
id: Joi.string(),
|
||||
thirdPartyData: Joi.object(),
|
||||
server_id: Joi.string(),
|
||||
object: Joi.string(),
|
||||
});
|
||||
const recipientList = Joi.array().items(recipient);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class SendmailClient {
|
|||
// TODO: figure out how to parse different errors, like in cloud-core
|
||||
// https://github.com/nylas/cloud-core/blob/production/sync-engine/inbox/sendmail/smtp/postel.py#L354
|
||||
|
||||
if (err.message.startsWith("Error: Invalid login: 535-5.7.8 Username and Password not accepted.")) {
|
||||
if (err.message.startsWith("Invalid login: 535-5.7.8 Username and Password not accepted.")) {
|
||||
throw new HTTPError('Invalid login', 401, err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue