1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2025-01-05 19:15:32 +00:00

dbus: Add more DBus properties

These are needed to allow Phosh to handle incoming calls on
the locked screen.
This commit is contained in:
Guido Günther 2021-06-25 15:47:30 +02:00
parent 8bf320e006
commit f45ba43720
2 changed files with 36 additions and 4 deletions

View file

@ -108,22 +108,34 @@ call_added_cb (CallsDBusManager *self, CallsCall *call)
g_autoptr (GError) error = NULL;
g_autoptr (CallsDBusObjectSkeleton) object = NULL;
g_autoptr (CallsDBusCallsCall) iface = NULL;
g_autoptr (CallsBestMatch) match = NULL;
path = get_obj_path (self, self->iface_num++);
object = calls_dbus_object_skeleton_new (path);
iface = calls_dbus_calls_call_skeleton_new ();
g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object),
G_DBUS_INTERFACE_SKELETON (iface));
g_object_set_data_full (G_OBJECT (object), "call", g_object_ref (call), g_object_unref);
/* Keep in sync with call object */
g_object_set_data_full (G_OBJECT (object), "call", g_object_ref (call), g_object_unref);
g_object_connect (iface,
"object_signal::handle-accept", G_CALLBACK (on_handle_call_accept), call,
"object_signal::handle-hangup", G_CALLBACK (on_handle_call_hangup), call,
NULL);
g_object_bind_property (call, "state", iface, "state", G_BINDING_SYNC_CREATE);
g_object_bind_property (call, "inbound", iface, "inbound", G_BINDING_SYNC_CREATE);
g_object_bind_property (call, "number", iface, "id", G_BINDING_SYNC_CREATE);
g_object_bind_property (call, "protocol", iface, "protocol", G_BINDING_SYNC_CREATE);
/* TODO: once calls supports encryption */
calls_dbus_calls_call_set_encrypted (iface, FALSE);
/* Keep in sync BestMatch object */
match = calls_call_get_contact (call);
if (calls_best_match_has_individual (match)) {
g_object_bind_property (match, "name", iface, "display-name", G_BINDING_SYNC_CREATE);
/* TODO: avatar once https://source.puri.sm/Librem5/calls/-/issues/161 is fixed */
}
g_object_set_data_full (G_OBJECT (object), "contact", g_steal_pointer (&match), g_object_unref);
/* Export with properties bound to reduce DBus traffic: */
g_debug ("Exporting %p at %s", call, path);

View file

@ -33,7 +33,27 @@
</doc:description>
</doc:doc>
</property>
<property name="Party" type="s" access="read"/>
<property name="DisplayName" type="s" access="read">
<doc:doc>
<doc:description>
<doc:para>The DisplayName of the calling party, e.g. from address book</doc:para>
</doc:description>
</doc:doc>
</property>
<property name="Protocol" type="s" access="read">
<doc:doc>
<doc:description>
<doc:para>The protocol used for this call</doc:para>
</doc:description>
</doc:doc>
</property>
<property name="Encrypted" type="b" access="read">
<doc:doc>
<doc:description>
<doc:para>Whether the call is encrypted. This does not indicate anything about the
type of encryption being used.</doc:para>
</doc:description>
</doc:doc>
</property>
</interface>
</node>