Don't pass OAuth2TokenProvider to RemoteStore and Transport
This commit is contained in:
parent
74017c926e
commit
f9ed304770
5 changed files with 9 additions and 9 deletions
|
@ -20,12 +20,12 @@ public abstract class Transport {
|
||||||
// RFC 1047
|
// RFC 1047
|
||||||
protected static final int SOCKET_READ_TIMEOUT = 300000;
|
protected static final int SOCKET_READ_TIMEOUT = 300000;
|
||||||
|
|
||||||
public synchronized static Transport getInstance(Context context, StoreConfig storeConfig,
|
public static synchronized Transport getInstance(Context context, StoreConfig storeConfig)
|
||||||
OAuth2TokenProvider oauth2TokenProvider) throws MessagingException {
|
throws MessagingException {
|
||||||
String uri = storeConfig.getTransportUri();
|
String uri = storeConfig.getTransportUri();
|
||||||
if (uri.startsWith("smtp")) {
|
if (uri.startsWith("smtp")) {
|
||||||
return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context),
|
OAuth2TokenProvider oauth2TokenProvider = null;
|
||||||
oauth2TokenProvider);
|
return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context), oauth2TokenProvider);
|
||||||
} else if (uri.startsWith("webdav")) {
|
} else if (uri.startsWith("webdav")) {
|
||||||
return new WebDavTransport(storeConfig);
|
return new WebDavTransport(storeConfig);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -41,8 +41,7 @@ public abstract class RemoteStore extends Store {
|
||||||
/**
|
/**
|
||||||
* Get an instance of a remote mail store.
|
* Get an instance of a remote mail store.
|
||||||
*/
|
*/
|
||||||
public synchronized static Store getInstance(Context context, StoreConfig storeConfig,
|
public static synchronized Store getInstance(Context context, StoreConfig storeConfig) throws MessagingException {
|
||||||
OAuth2TokenProvider oAuth2TokenProvider) throws MessagingException {
|
|
||||||
String uri = storeConfig.getStoreUri();
|
String uri = storeConfig.getStoreUri();
|
||||||
|
|
||||||
if (uri.startsWith("local")) {
|
if (uri.startsWith("local")) {
|
||||||
|
@ -52,6 +51,7 @@ public abstract class RemoteStore extends Store {
|
||||||
Store store = sStores.get(uri);
|
Store store = sStores.get(uri);
|
||||||
if (store == null) {
|
if (store == null) {
|
||||||
if (uri.startsWith("imap")) {
|
if (uri.startsWith("imap")) {
|
||||||
|
OAuth2TokenProvider oAuth2TokenProvider = null;
|
||||||
store = new ImapStore(
|
store = new ImapStore(
|
||||||
storeConfig,
|
storeConfig,
|
||||||
new DefaultTrustedSocketFactory(context),
|
new DefaultTrustedSocketFactory(context),
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ public class Account implements BaseAccount, StoreConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Store getRemoteStore() throws MessagingException {
|
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
|
// It'd be great if this actually went into the store implementation
|
||||||
|
|
|
@ -475,7 +475,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList
|
||||||
if (!(account.getRemoteStore() instanceof WebDavStore)) {
|
if (!(account.getRemoteStore() instanceof WebDavStore)) {
|
||||||
publishProgress(R.string.account_setup_check_settings_check_outgoing_msg);
|
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();
|
transport.close();
|
||||||
try {
|
try {
|
||||||
transport.open();
|
transport.open();
|
||||||
|
|
|
@ -2973,7 +2973,7 @@ public class MessagingController {
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Scanning folder '" + account.getOutboxFolderName() + "' (" + localFolder.getId() + ") for messages to send");
|
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) {
|
for (LocalMessage message : localMessages) {
|
||||||
if (message.isSet(Flag.DELETED)) {
|
if (message.isSet(Flag.DELETED)) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
|
|
Loading…
Reference in a new issue