Remove CallsCredentials and adapt to changes

The provider knows best which credentials it needs and CallsCredentials
was not generic to begin with, so get rid of it.
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-07-04 00:20:57 +02:00
committed by Evangelos Ribeiro Tzaras
parent 10a2046549
commit babd013bd7
16 changed files with 418 additions and 1184 deletions

View File

@@ -44,75 +44,3 @@ calls_account_provider_default_init (CallsAccountProviderInterface *iface)
{
}
/**
* calls_account_provider_add_account:
* @self: A #CallsAccountProvider
* @credentials: A #CallsCredentials
*
* Add an account.
*
* Returns: %TRUE if successfully added, %FALSE otherwise
*/
gboolean
calls_account_provider_add_account (CallsAccountProvider *self,
CallsCredentials *credentials)
{
CallsAccountProviderInterface *iface;
g_return_val_if_fail (CALLS_IS_ACCOUNT_PROVIDER (self), FALSE);
iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self);
g_return_val_if_fail (iface->add_account != NULL, FALSE);
g_debug ("Trying to add account for %s", calls_credentials_get_name (credentials));
return iface->add_account (self, credentials);
}
/**
* calls_account_provider_remove_account:
* @self: A #CallsAccountProvider
* @credentials: A #CallsCredentials
*
* Removes an account.
*
* Returns: %TRUE if successfully removed, %FALSE otherwise
*/
gboolean
calls_account_provider_remove_account (CallsAccountProvider *self,
CallsCredentials *credentials)
{
CallsAccountProviderInterface *iface;
g_return_val_if_fail (CALLS_IS_ACCOUNT_PROVIDER (self), FALSE);
iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self);
g_return_val_if_fail (iface->remove_account != NULL, FALSE);
g_debug ("Trying to remove account from %s", calls_credentials_get_name (credentials));
return iface->remove_account (self, credentials);
}
/**
* calls_account_provider_get_account:
* @self: A #CallsAccountProvider
* @credentials: A #CallsCredentials
*
* Get the account which is using #CallsCredentials
*/
CallsAccount *
calls_account_provider_get_account (CallsAccountProvider *self,
CallsCredentials *credentials)
{
CallsAccountProviderInterface *iface;
g_return_val_if_fail (CALLS_IS_ACCOUNT_PROVIDER (self), NULL);
iface = CALLS_ACCOUNT_PROVIDER_GET_IFACE (self);
g_return_val_if_fail (iface->get_account != NULL, NULL);
g_debug ("Trying to get account from %s", calls_credentials_get_name (credentials));
return iface->get_account (self, credentials);
}