~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/engine/api/geary-account-information.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-10-10 17:40:37 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20131010174037-5p5o4dlsoewek2kg
Tags: 0.4.0-0ubuntu1
New stable version

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
     * true if all passwords were retrieved from the key store or the user
158
158
     * proceeded normally if/when prompted, false if the user tried to cancel
159
159
     * the prompt.
 
160
     *
 
161
     * If force_request is set to true, a prompt will appear regardless.
160
162
     */
161
 
    public async bool fetch_passwords_async(CredentialsMediator.ServiceFlag services) throws Error {
 
163
    public async bool fetch_passwords_async(CredentialsMediator.ServiceFlag services,
 
164
        bool force_request = false) throws Error {
 
165
        if (force_request) {
 
166
            // Delete the current password(s).
 
167
            if (services.has_imap()) {
 
168
                yield Geary.Engine.instance.authentication_mediator.clear_password_async(
 
169
                    CredentialsMediator.Service.IMAP, email);
 
170
                
 
171
                if (imap_credentials != null)
 
172
                    imap_credentials.pass = null;
 
173
            } else if (services.has_smtp()) {
 
174
                yield Geary.Engine.instance.authentication_mediator.clear_password_async(
 
175
                    CredentialsMediator.Service.SMTP, email);
 
176
                
 
177
                if (smtp_credentials != null)
 
178
                    smtp_credentials.pass = null;
 
179
            }
 
180
        }
 
181
        
162
182
        // Only call get_passwords on anything that hasn't been set
163
183
        // (incorrectly) previously.
164
184
        CredentialsMediator.ServiceFlag get_services = 0;