[calls/wip/ui-manage-accounts: 6/26] account-provider: Test if credentials to be added are suitable




commit 8b27c5a055195dcae76d60cb804c9e30c27df65a
Author: Evangelos Ribeiro Tzaras <evangelos tzaras puri sm>
Date:   Tue Jun 29 11:11:52 2021 +0200

    account-provider: Test if credentials to be added are suitable

 src/calls-account-provider.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/calls-account-provider.c b/src/calls-account-provider.c
index 9a0d7972..75826398 100644
--- a/src/calls-account-provider.c
+++ b/src/calls-account-provider.c
@@ -75,6 +75,14 @@ calls_account_provider_add_account (CallsAccountProvider *self,
 
   g_debug ("Trying to add account for %s", calls_credentials_get_name (credentials));
 
+  if (calls_credentials_get_credentials_type (credentials) !=
+      calls_account_provider_get_credentials_type (self)) {
+    g_info ("Credentials %s not suitable for provider %s",
+            calls_credentials_get_name (credentials),
+            calls_provider_get_name (CALLS_PROVIDER (self)));
+    return FALSE;
+  }
+
   account = iface->add_account (self, credentials);
 
   if (account) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]