X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-default-connection-policy.c;h=778ca0e93f34391f8a91bb1ec856c90c2d31033c;hp=eac9e221b7d8113105292bad73638f45d764a493;hb=cdbab669714f015b98fbce83b8e147df6ab27e82;hpb=a87b228eaa0848907bd3e7f722d644dc1cb2dbd4 diff --git a/src/modest-default-connection-policy.c b/src/modest-default-connection-policy.c index eac9e22..778ca0e 100644 --- a/src/modest-default-connection-policy.c +++ b/src/modest-default-connection-policy.c @@ -1,15 +1,40 @@ -/* Your copyright here */ +/* Copyright (c) 2006, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #include #include -#include - -#define MODEST_DEFAULT_CONNECTION_POLICY_C -gboolean exiting = FALSE; -#include -#undef MODEST_DEFAULT_CONNECTION_POLICY_C +#include "modest-default-connection-policy.h" +#include "modest-account-mgr-helpers.h" +#include "modest-runtime.h" #include +#include static GObjectClass *parent_class = NULL; @@ -22,6 +47,12 @@ modest_default_connection_policy_set_current (TnyConnectionPolicy *self, TnyAcco static void modest_default_connection_policy_on_connect (TnyConnectionPolicy *self, TnyAccount *account) { + /* Set the username as succedded */ + if (TNY_IS_STORE_ACCOUNT (account)) + modest_account_mgr_set_server_account_username_has_succeeded (modest_runtime_get_account_mgr (), + tny_account_get_id (account), + TRUE); + return; } @@ -34,7 +65,6 @@ modest_default_connection_policy_on_connection_broken (TnyConnectionPolicy *self static void modest_default_connection_policy_on_disconnect (TnyConnectionPolicy *self, TnyAccount *account) { - tny_account_cancel (account); return; }