1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-30 15:49:31 +00:00

sip: origin: Set and update name of origin

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-07-06 13:42:47 +02:00 committed by Evangelos Ribeiro Tzaras
parent 5c1b76908b
commit e9f155678e

View file

@ -1030,6 +1030,19 @@ supports_protocol (CallsOrigin *origin,
}
static void
update_name (CallsSipOrigin *self)
{
g_assert (CALLS_IS_SIP_ORIGIN (self));
if (self->display_name && self->display_name[0] != '\0')
self->name = self->display_name;
else
self->name = self->user;
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NAME]);
}
static void
calls_sip_origin_set_property (GObject *object,
guint property_id,
@ -1189,6 +1202,8 @@ calls_sip_origin_constructed (GObject *object)
g_warning ("Error initializing the SIP account: %s", error->message);
}
update_name (self);
self->media_manager = calls_sip_media_manager_default ();
G_OBJECT_CLASS (calls_sip_origin_parent_class)->constructed (object);
@ -1418,6 +1433,8 @@ calls_sip_origin_set_credentials (CallsSipOrigin *self,
self->port = port;
update_name (self);
/* Propagate changes to nua stack */
update_nua (self);
}