Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9ed3047 authored by cketti's avatar cketti
Browse files

Don't pass OAuth2TokenProvider to RemoteStore and Transport

parent 74017c92
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -20,12 +20,12 @@ public abstract class Transport {
    // RFC 1047
    protected static final int SOCKET_READ_TIMEOUT = 300000;

    public synchronized static Transport getInstance(Context context, StoreConfig storeConfig,
             OAuth2TokenProvider oauth2TokenProvider) throws MessagingException {
    public static synchronized Transport getInstance(Context context, StoreConfig storeConfig) 
            throws MessagingException {
        String uri = storeConfig.getTransportUri();
        if (uri.startsWith("smtp")) {
            return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context),
                    oauth2TokenProvider);
            OAuth2TokenProvider oauth2TokenProvider = null;
            return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context), oauth2TokenProvider);
        } else if (uri.startsWith("webdav")) {
            return new WebDavTransport(storeConfig);
        } else {
+2 −2
Original line number Diff line number Diff line
@@ -41,8 +41,7 @@ public abstract class RemoteStore extends Store {
    /**
     * Get an instance of a remote mail store.
     */
    public synchronized static Store getInstance(Context context, StoreConfig storeConfig,
            OAuth2TokenProvider oAuth2TokenProvider) throws MessagingException {
    public static synchronized Store getInstance(Context context, StoreConfig storeConfig) throws MessagingException {
        String uri = storeConfig.getStoreUri();

        if (uri.startsWith("local")) {
@@ -52,6 +51,7 @@ public abstract class RemoteStore extends Store {
        Store store = sStores.get(uri);
        if (store == null) {
            if (uri.startsWith("imap")) {
                OAuth2TokenProvider oAuth2TokenProvider = null;
                store = new ImapStore(
                        storeConfig,
                        new DefaultTrustedSocketFactory(context),
+1 −1
Original line number Diff line number Diff line
@@ -1287,7 +1287,7 @@ public class Account implements BaseAccount, StoreConfig {
    }

    public Store getRemoteStore() throws MessagingException {
        return RemoteStore.getInstance(K9.app, this, null);
        return RemoteStore.getInstance(K9.app, this);
    }

    // It'd be great if this actually went into the store implementation
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList
            if (!(account.getRemoteStore() instanceof WebDavStore)) {
                publishProgress(R.string.account_setup_check_settings_check_outgoing_msg);
            }
            Transport transport = Transport.getInstance(K9.app, account, null);
            Transport transport = Transport.getInstance(K9.app, account);
            transport.close();
            try {
                transport.open();
+1 −1
Original line number Diff line number Diff line
@@ -2973,7 +2973,7 @@ public class MessagingController {
            if (K9.DEBUG)
                Log.i(K9.LOG_TAG, "Scanning folder '" + account.getOutboxFolderName() + "' (" + localFolder.getId() + ") for messages to send");

            Transport transport = Transport.getInstance(K9.app, account, null);
            Transport transport = Transport.getInstance(K9.app, account);
            for (LocalMessage message : localMessages) {
                if (message.isSet(Flag.DELETED)) {
                    message.destroy();