1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-17 07:46:03 +00:00

sip: provider: Add API to remove origins

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-07-06 01:36:11 +02:00 committed by Evangelos Ribeiro Tzaras
parent 1a4b501653
commit 1749dcec60
4 changed files with 23 additions and 0 deletions

View file

@ -1380,6 +1380,7 @@ calls_sip_origin_set_credentials (CallsSipOrigin *self,
const char *password,
const char *display_name,
const char *transport_protocol,
gint port,
gboolean auto_connect)
{
g_return_if_fail (CALLS_IS_SIP_ORIGIN (self));
@ -1415,6 +1416,8 @@ calls_sip_origin_set_credentials (CallsSipOrigin *self,
else
self->transport_protocol = g_strdup ("UDP");
self->port = port;
/* Propagate changes to nua stack */
update_nua (self);
}

View file

@ -38,6 +38,7 @@ void calls_sip_origin_set_credentials (CallsSipOrigin *sel
const char *password,
const char *display_name,
const char *transport_protocol,
gint port,
gboolean auto_connect);
G_END_DECLS

View file

@ -496,6 +496,23 @@ calls_sip_provider_add_origin_full (CallsSipProvider *self,
}
gboolean
calls_sip_provider_remove_origin (CallsSipProvider *self,
CallsSipOrigin *origin)
{
guint position;
g_return_val_if_fail (CALLS_IS_SIP_PROVIDER (self), FALSE);
g_return_val_if_fail (CALLS_IS_SIP_ORIGIN (origin), FALSE);
if (g_list_store_find (self->origins, origin, &position)) {
g_list_store_remove (self->origins, position);
return TRUE;
}
return FALSE;
}
CallsSipProvider *
calls_sip_provider_new (void)
{

View file

@ -54,6 +54,8 @@ CallsSipOrigin *calls_sip_provider_add_origin_full (CallsSipProvider *s
gboolean auto_connect,
gboolean direct_mode,
gint local_port);
gboolean calls_sip_provider_remove_origin (CallsSipProvider *self,
CallsSipOrigin *origin);
void calls_sip_provider_load_accounts (CallsSipProvider *self,
GKeyFile *key_file);
void peas_register_types (PeasObjectModule *module);