mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 18:44:01 +08:00
[local-sync] Cleanup, use Provider constants
This commit is contained in:
parent
941c564443
commit
bda6a78ae1
3 changed files with 4 additions and 7 deletions
|
@ -140,10 +140,6 @@ module.exports = (sequelize, Sequelize) => {
|
|||
|
||||
return config;
|
||||
},
|
||||
|
||||
supportsLabels() {
|
||||
return this.provider === 'gmail'
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const Joi = require('joi');
|
||||
const {Provider} = require('isomorphic-core')
|
||||
const Serialization = require('../serialization');
|
||||
const {createAndReplyWithSyncbackRequest} = require('../route-helpers');
|
||||
|
||||
|
@ -118,7 +119,7 @@ module.exports = (server) => {
|
|||
const payload = request.payload
|
||||
if (payload.label_ids || payload.labels) {
|
||||
const account = request.auth.credentials;
|
||||
if (account.supportsLabels()) {
|
||||
if (account.provider === Provider.Gmail) {
|
||||
createAndReplyWithSyncbackRequest(request, reply, {
|
||||
type: "SetMessageLabels",
|
||||
props: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const {SendmailClient, Errors: {APIError}} = require('isomorphic-core')
|
||||
const {SendmailClient, Provider, Errors: {APIError}} = require('isomorphic-core')
|
||||
const IMAPHelpers = require('../imap-helpers')
|
||||
const SyncbackTask = require('./syncback-task')
|
||||
|
||||
|
@ -48,7 +48,7 @@ class EnsureMessageInSentFolderIMAP extends SyncbackTask {
|
|||
// Each participant gets a message, but all of those messages have the
|
||||
// same Message-ID header in them. This allows us to find all of the
|
||||
// sent messages and clean them up
|
||||
if (sentPerRecipient && provider === 'gmail') {
|
||||
if (sentPerRecipient && provider === Provider.Gmail) {
|
||||
try {
|
||||
await IMAPHelpers.deleteGmailSentMessages({db, imap, provider, headerMessageId})
|
||||
} catch (err) {
|
||||
|
|
Loading…
Reference in a new issue