Commit 30b55a03 authored by Michael Gratton's avatar Michael Gratton 🤞

Remove now-unused prompting code from Mediator implementations

parent 085518a6
......@@ -332,7 +332,7 @@ public class GearyController : Geary.BaseObject {
SecretMediator? libsecret = null;
try {
libsecret = yield new SecretMediator(this.application, cancellable);
libsecret = yield new SecretMediator(cancellable);
} catch (GLib.Error err) {
error("Error opening libsecret: %s", err.message);
}
......
......@@ -94,17 +94,6 @@ public class GoaMediator : Geary.CredentialsMediator, Object {
return loaded;
}
public virtual async bool prompt_token(Geary.AccountInformation account,
Geary.ServiceInformation service,
GLib.Cancellable? cancellable)
throws GLib.Error {
// XXX Open a dialog that says "Click here to change your GOA
// password" or "GOA credentials need renewing" or
// something. Connect to the GOA service and wait until we
// hear that needs attention is no longer true.
return false;
}
private Geary.Credentials.Method get_auth_method() throws GLib.Error {
if (this.handle.get_oauth2_based() != null) {
return Geary.Credentials.Method.OAUTH2;
......
......@@ -35,14 +35,9 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
null
);
private GearyApplication application;
private Geary.Nonblocking.Mutex dialog_mutex = new Geary.Nonblocking.Mutex();
public async SecretMediator(GearyApplication application,
GLib.Cancellable? cancellable)
public async SecretMediator(GLib.Cancellable? cancellable)
throws GLib.Error {
this.application = application;
yield check_unlocked(cancellable);
}
......@@ -70,44 +65,6 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
return loaded;
}
public virtual async bool prompt_token(Geary.AccountInformation account,
Geary.ServiceInformation service,
GLib.Cancellable? cancellable)
throws GLib.Error {
if (service.credentials != null) {
// to prevent multiple dialogs from popping up at the same
// time, use a nonblocking mutex to serialize the code
int token = yield dialog_mutex.claim_async(null);
// Ensure main window present to the window
this.application.present();
PasswordDialog password_dialog = new PasswordDialog(
this.application.get_active_window(),
account,
service
);
bool result = password_dialog.run();
dialog_mutex.release(ref token);
if (result) {
// password_dialog.password should never be null at this
// point. It will only be null when password_dialog.run()
// returns false, in which case we have already returned.
service.credentials = service.credentials.copy_with_token(
password_dialog.password
);
service.remember_password = password_dialog.remember_password;
yield update_token(account, service, cancellable);
account.changed();
}
}
return true;
}
public async void update_token(Geary.AccountInformation account,
Geary.ServiceInformation service,
Cancellable? cancellable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment