Commit 5cee01a4 authored by Henry-Nicolas Tourneur's avatar Henry-Nicolas Tourneur
Browse files

New upstream version 0.1.9

parent 3c3da05f
......@@ -15,8 +15,11 @@ variables:
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install $DEPS wget ca-certificates gnupg
- echo "deb http://ci.puri.sm/ bullseyeci main" > /etc/apt/sources.list.d/ci.list
- wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
- apt-get -y update
- apt-get -y build-dep .
- apt-get -y install $DEPS
- ulimit -c unlimited
.tags: &tags
......@@ -33,6 +36,9 @@ build:native:
script:
- meson --werror . _build
- ninja -C _build
except:
variables:
- $PKG_ONLY == "1"
test:native:
<<: *tags
......@@ -43,6 +49,9 @@ test:native:
script:
- export LC_ALL=C.UTF-8
- xvfb-run ninja -C _build test
except:
variables:
- $PKG_ONLY == "1"
package:deb-debian-buster:
extends: .l5-build-debian-package
......
......@@ -21,9 +21,17 @@
<foaf:mbox rdf:resource="mailto:bob.ham@puri.sm" />
<foaf:mbox rdf:resource="mailto:rah@settrans.net" />
</foaf:Person>
</maintainer>
<maintainer>
<foaf:Person>
<foaf:name>Julian Sparber</foaf:name>
<foaf:mbox rdf:resource="mailto:julian.sparber@puri.sm" />
</foaf:Person>
</maintainer>
<maintainer>
<foaf:Person>
<foaf:name>Evangelos Ribeiro Tzaras</foaf:name>
<foaf:mbox rdf:resource="mailto:devrtz@fortysixandtwo.eu" />
</foaf:Person>
</maintainer>
</Project>
......@@ -13,3 +13,4 @@ StartupNotify=true
Terminal=false
Categories=GNOME;GTK;Telephony;
MimeType=x-scheme-handler/tel
X-Purism-FormFactor=Workstation;Mobile;
......@@ -63,4 +63,9 @@
<description>Pre-release development</description>
</release>
</releases>
<custom>
<value key="Purism::form_factor">workstation</value>
<value key="Purism::form_factor">mobile</value>
</custom>
</component>
calls (0.1.9) amber-phone; urgency=medium
[ Juliano de Souza Camargo ]
* po: Add Portuguese translation
[ Fabio Tomat ]
* po: Just fur for friulian locale
[ Adrien Plazas ]
* Port to libhandy 1
* main-window: Use HdyViewSwitcherTitle
* data: List compatible form-factors
[ Evangelos Ribeiro Tzaras ]
* docs: update URLs to source.puri.sm
* po: fix duplicate language teams
[ Sebastian Krzyszkowiak ]
* gitlab-ci: Use bullseye CI repo
[ Anders Jonsson ]
* po: Update Swedish translation
[ Arnaud Ferraris ]
* call-display: replace ugly hacks with libcallaudio calls
* application: initialize libcallaudio on startup
* ui: call-display: set speaker and mute buttons sensitive by default
* src: meson.build: remove librem5-hack option and depend on libcallaudio
* d/control: depend on callaudiod
[ Mohammed Sadiq ]
* Add calls-ussd interface
* mm-origin: Implement CallsUssd interface
* util: Add API to test for USSD command
* manager: Hook to ussd signals from provider
* main-window: Add dialog to handle USSD
* new-call-box: Handle USSD commands
[ Evangelos Ribeiro Tzaras ]
* Bump max allowed glib version to 2.64
-- Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Wed, 04 Nov 2020 18:07:48 +0100
calls (0.1.8) amber-phone; urgency=medium
[ Arnaud Ferraris ]
* ui: call-display: wrap toggle buttons' labels.
For some locales, the buttons' labels can be quite long, making the
window wider than the display.
[ Evangelos Ribeiro Tzaras ]
* src/calls-notifier.c: Add call-back button
* src/calls-call-window.c: Inhibit suspend during active call
[ Guido Günther ]
* po: Add Hungarian to LINGUAS
* call-record-row: Use g_autoptr for the GError
* calls-call-record-row: Ignore anonymous callsers.
These have an empty string which leads to
Error parsing phone number `': Keine Telefonnumme
* po: Add Spanish to LINGUAS
* gitlab-ci: Allow to only build a package
* main-window: Allow the in app notification to wrap.
Othewise we overflow the window. Center it too.
* calls-main-window: Bring back old error string when no modem is present.
Calls can't tell the difference between no SIM and no modem
atm. (Closes: #159, #152)
* doap: Add devrtz to list of maintainers.
He's been the most active contributor recently.
* doap: Fix sytnax.
Wrap each person within <maintainer/>
[ James Westman ]
* flatpak: Add feedbackd, dependencies to flatpak.
Added feedbackd to the Flatpak manifest, so that Calls builds again.
Fixes #164.
[ Daniel Șerbănescu ]
* po: Update Romanian translation
[ Tim Sabsch ]
* po: Add German translation
[ Marc Riera Irigoyen ]
* po: Add Catalan translation
[ scootergrisen ]
* po: Add Danish translation
[ Balázs Meskó ]
* po: Add Hungarian translation
[ Emin Tufan Çetin ]
* po: Update Turkish translation
[ Valéry Febvre ]
* po: Update French translation
[ Daniel Mustieles ]
* po: Add Spanish translation
[ Efstathios Iosifidis ]
* po: Add Greek translation
[ Thibault Martin ]
* po: Update French translation
[ Fabio Tomat ]
* po: Add friulian translations
[ Марко М. Костић (Marko M. Kostić) ]
* po: Add Serbian translation
[ Yuri Chornoivan ]
* po: Update Ukrainian translation
-- Guido Günther <agx@sigxcpu.org> Fri, 18 Sep 2020 12:52:43 +0200
calls (0.1.7) amber-phone; urgency=medium
[ Yuri Chornoivan ]
......
......@@ -6,8 +6,9 @@ Uploaders:
Bob Ham <rah@settrans.net>,
Build-Depends:
debhelper (>= 11),
libcallaudio-dev,
libfeedback-dev,
libhandy-0.0-dev (>= 0.0.12),
libhandy-1-dev (>= 1.0.0),
libgtk-3-dev,
modemmanager-dev,
libmm-glib-dev (>= 1.12.0),
......@@ -29,6 +30,7 @@ Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
callaudiod,
modemmanager,
Description: Make and receive PSTN phone calls
A GTK+ user interface for PSTN phone calls using oFono.
ent_conf = configuration_data()
ent_conf.set('PACKAGE', 'Calls')
ent_conf.set('PACKAGE_BUGREPORT', 'https://code.puri.sm/Librem5/calls/issues')
ent_conf.set('PACKAGE_BUGREPORT', 'https://source.puri.sm/Librem5/calls/issues')
ent_conf.set('PACKAGE_NAME', 'Calls')
ent_conf.set('PACKAGE_STRING', 'calls')
ent_conf.set('PACKAGE_TARNAME', 'calls-' + meson.project_version())
ent_conf.set('PACKAGE_URL', 'https://code.puri.sm/Librem5/calls')
ent_conf.set('PACKAGE_URL', 'https://source.puri.sm/Librem5/calls')
ent_conf.set('PACKAGE_VERSION', meson.project_version())
configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf)
......@@ -22,7 +22,7 @@
project(
'calls',
'c', 'vala',
version: '0.1.7',
version: '0.1.8',
license: 'GPLv3+',
meson_version: '>= 0.47.0',
default_options: [
......@@ -60,7 +60,7 @@ config_data.set('PACKAGE_URL_RAW', calls_homepage)
add_project_arguments([
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_58',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_60',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_64',
], language: 'c')
subdir('po')
......
......@@ -9,7 +9,3 @@ option('tests',
option('wayland',
type: 'feature', value: 'enabled',
description: 'Whether to support Wayland lockscreen interaction')
option('librem5-hack',
type: 'boolean', value: true,
description: 'Whether to use hacky code to support audio output switching (Speaker)')
......@@ -24,6 +24,7 @@
#include "calls-mm-origin.h"
#include "calls-origin.h"
#include "calls-ussd.h"
#include "calls-mm-call.h"
#include "calls-message-source.h"
......@@ -35,16 +36,28 @@ struct _CallsMMOrigin
GObject parent_instance;
MMObject *mm_obj;
MMModemVoice *voice;
MMModem3gppUssd *ussd;
/* XXX: These should be used only for pointer comparison,
* The content should never be used as it might be
* pointing to a freed location */
char *last_ussd_request;
char *last_ussd_response;
gulong ussd_handle_id;
gchar *name;
GHashTable *calls;
};
static void calls_mm_origin_message_source_interface_init (CallsOriginInterface *iface);
static void calls_mm_origin_origin_interface_init (CallsOriginInterface *iface);
static void calls_mm_origin_ussd_interface_init (CallsUssdInterface *iface);
G_DEFINE_TYPE_WITH_CODE (CallsMMOrigin, calls_mm_origin, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
calls_mm_origin_message_source_interface_init)
G_IMPLEMENT_INTERFACE (CALLS_TYPE_USSD,
calls_mm_origin_ussd_interface_init)
G_IMPLEMENT_INTERFACE (CALLS_TYPE_ORIGIN,
calls_mm_origin_origin_interface_init))
......@@ -56,6 +69,231 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
static void
ussd_initiate_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
g_autoptr(GTask) task = user_data;
CallsMMOrigin *self = user_data;
char *response = NULL;
GError *error = NULL;
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (MM_IS_MODEM_3GPP_USSD (ussd));
g_assert (CALLS_IS_MM_ORIGIN (self));
response = mm_modem_3gpp_ussd_initiate_finish (ussd, result, &error);
if (error)
g_task_return_error (task, error);
else
g_task_return_pointer (task, response, g_free);
}
static void
ussd_reinitiate_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
CallsUssd *ussd = (CallsUssd *)object;
g_autoptr(GTask) task = user_data;
CallsMMOrigin *self = user_data;
GCancellable *cancellable;
GError *error = NULL;
const char *command;
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (CALLS_IS_USSD (ussd));
g_assert (CALLS_IS_MM_ORIGIN (self));
calls_ussd_cancel_finish (ussd, result, &error);
cancellable = g_task_get_cancellable (task);
command = g_task_get_task_data (task);
if (error)
g_task_return_error (task, error);
else
mm_modem_3gpp_ussd_initiate (self->ussd, command, cancellable,
ussd_initiate_cb, g_steal_pointer (&task));
}
static void
ussd_respond_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
CallsMMOrigin *self;
g_autoptr(GTask) task = user_data;
char *response = NULL;
GError *error = NULL;
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (CALLS_IS_MM_ORIGIN (self));
g_assert (MM_IS_MODEM_3GPP_USSD (ussd));
response = mm_modem_3gpp_ussd_respond_finish (ussd, result, &error);
if (error)
g_task_return_error (task, error);
else
g_task_return_pointer (task, response, g_free);
}
static void
ussd_cancel_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
CallsMMOrigin *self;
g_autoptr(GTask) task = user_data;
GError *error = NULL;
gboolean response;
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (CALLS_IS_MM_ORIGIN (self));
g_assert (MM_IS_MODEM_3GPP_USSD (ussd));
response = mm_modem_3gpp_ussd_cancel_finish (ussd, result, &error);
if (error)
g_task_return_error (task, error);
else
g_task_return_boolean (task, response);
}
static CallsUssdState
calls_mm_ussd_get_state (CallsUssd *ussd)
{
CallsMMOrigin *self = CALLS_MM_ORIGIN (ussd);
if (!self->ussd)
return CALLS_USSD_STATE_UNKNOWN;
return mm_modem_3gpp_ussd_get_state (self->ussd);
}
static void
calls_mm_ussd_initiate_async (CallsUssd *ussd,
const char *command,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
CallsMMOrigin *self = CALLS_MM_ORIGIN (ussd);
g_autoptr(GTask) task = NULL;
CallsUssdState state;
g_return_if_fail (CALLS_IS_USSD (ussd));
task = g_task_new (self, cancellable, callback, user_data);
if (!self->ussd)
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"No USSD interface found");
return;
}
if (!command || !*command)
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
"USSD command empty");
return;
}
state = calls_ussd_get_state (CALLS_USSD (self));
g_task_set_task_data (task, g_strdup (command), g_free);
if (state == CALLS_USSD_STATE_ACTIVE ||
state == CALLS_USSD_STATE_USER_RESPONSE)
calls_ussd_cancel_async (CALLS_USSD (self), cancellable,
ussd_reinitiate_cb, g_steal_pointer (&task));
else
mm_modem_3gpp_ussd_initiate (self->ussd, command, cancellable,
ussd_initiate_cb, g_steal_pointer (&task));
}
static char *
calls_mm_ussd_initiate_finish (CallsUssd *ussd,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (CALLS_IS_USSD (ussd), NULL);
g_return_val_if_fail (G_IS_TASK (result), NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
static void
calls_mm_ussd_respond_async (CallsUssd *ussd,
const char *response,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
CallsMMOrigin *self = CALLS_MM_ORIGIN (ussd);
GTask *task;
g_return_if_fail (CALLS_IS_USSD (ussd));
task = g_task_new (self, cancellable, callback, user_data);
mm_modem_3gpp_ussd_respond (self->ussd, response, cancellable,
ussd_respond_cb, task);
}
static char *
calls_mm_ussd_respond_finish (CallsUssd *ussd,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (CALLS_IS_USSD (ussd), NULL);
g_return_val_if_fail (G_IS_TASK (result), NULL);
return g_task_propagate_pointer (G_TASK (result), error);
}
static void
calls_mm_ussd_cancel_async (CallsUssd *ussd,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
CallsMMOrigin *self = CALLS_MM_ORIGIN (ussd);
GTask *task;
g_return_if_fail (CALLS_IS_USSD (ussd));
task = g_task_new (self, cancellable, callback, user_data);
mm_modem_3gpp_ussd_cancel (self->ussd, cancellable,
ussd_cancel_cb, task);
}
static gboolean
calls_mm_ussd_cancel_finish (CallsUssd *ussd,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (CALLS_IS_USSD (ussd), FALSE);
g_return_val_if_fail (G_IS_TASK (result), FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
static const gchar *
get_name (CallsOrigin *origin)
{
......@@ -427,6 +665,72 @@ modem_get_name (MMModem *modem)
}
static void
ussd_properties_changed_cb (CallsMMOrigin *self,
GVariant *properties)
{
const char *response;
GVariant *value;
CallsUssdState state;
g_assert (CALLS_IS_MM_ORIGIN (self));
state = calls_ussd_get_state (CALLS_USSD (self));
value = g_variant_lookup_value (properties, "State", NULL);
if (value)
g_signal_emit_by_name (self, "ussd-state-changed");
g_clear_pointer (&value, g_variant_unref);
/* XXX: We check for user state only because the NetworkRequest
* dbus property change isn't regularly emitted */
if (state == CALLS_USSD_STATE_USER_RESPONSE ||
(value = g_variant_lookup_value (properties, "NetworkRequest", NULL)))
{
response = mm_modem_3gpp_ussd_get_network_request (self->ussd);
if (response && *response && response != self->last_ussd_request)
g_signal_emit_by_name (self, "ussd-added", response);
if (response && *response)
self->last_ussd_request = (char *)response;
g_clear_pointer (&value, g_variant_unref);
}
if (state != CALLS_USSD_STATE_USER_RESPONSE &&
(value = g_variant_lookup_value (properties, "NetworkNotification", NULL)))
{
response = mm_modem_3gpp_ussd_get_network_notification (self->ussd);
if (response && *response && response != self->last_ussd_response)
g_signal_emit_by_name (self, "ussd-added", response);
if (response && *response)
self->last_ussd_response = (char *)response;
g_clear_pointer (&value, g_variant_unref);
}
}
static void
call_mm_ussd_changed_cb (CallsMMOrigin *self)
{
g_assert (CALLS_IS_MM_ORIGIN (self));
if (self->ussd_handle_id)
g_signal_handler_disconnect (self, self->ussd_handle_id);
self->ussd_handle_id = 0;
g_clear_object (&self->ussd);
self->ussd = mm_object_get_modem_3gpp_ussd (self->mm_obj);
/* XXX: We hook to dbus properties changed because the regular signal emission is inconsistent */
if (self->ussd)
self->ussd_handle_id = g_signal_connect_object (self->ussd, "g-properties-changed",
G_CALLBACK (ussd_properties_changed_cb), self,
G_CONNECT_SWAPPED);
}
static void
constructed (GObject *object)
{
......@@ -435,6 +739,11 @@ constructed (GObject *object)
self->name = modem_get_name (mm_object_get_modem (self->mm_obj));
g_signal_connect_object (self->mm_obj, "notify::modem3gpp-ussd",
G_CALLBACK (call_mm_ussd_changed_cb), self,
G_CONNECT_SWAPPED);
call_mm_ussd_changed_cb (self);
self->voice = mm_object_get_modem_voice (self->mm_obj);
g_assert (self->voice != NULL);
......@@ -460,6 +769,7 @@ dispose (GObject *object)
remove_calls (self, NULL);
g_clear_object (&self->mm_obj);
g_clear_object (&self->ussd);
G_OBJECT_CLASS (calls_mm_origin_parent_class)->dispose (object);
}
......@@ -504,6 +814,19 @@ calls_mm_origin_message_source_interface_init (CallsOriginInterface *iface)
}
static void
calls_mm_origin_ussd_interface_init (CallsUssdInterface *iface)
{
iface->get_state = calls_mm_ussd_get_state;
iface->initiate_async = calls_mm_ussd_initiate_async;
iface->initiate_finish = calls_mm_ussd_initiate_finish;
iface->respond