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

Merge branch 'update_package_0.3.2-1' into 'debian/master'

Update to 0.3.2

See merge request DebianOnMobile-team/gnome-calls!3
parents be29e73b eb2ccd99
......@@ -40,7 +40,7 @@ test:native:
- build:native
script:
- export LC_ALL=C.UTF-8
- xvfb-run ninja -C _build test
- xvfb-run -s -noreset ninja -C _build test
build-gtkdoc:
extends: build:native
......@@ -83,22 +83,6 @@ check-po:
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
- tar cf repo.tar repo/
# Run automatic tests inside the Flatpak env
# we need to recreate the build directory because cleanup would have deleted build dependencies
- rm -rf flatpak_app
- flatpak-builder --user --disable-rofiles-fuse --build-only flatpak_app ${MANIFEST_PATH}
- flatpak build-finish --socket=x11 --share=network flatpak_app
- >
xvfb-run -a -s "-screen 0 1024x768x24"
flatpak-builder --user --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} <<END
LANG=C.UTF-8
NO_AT_BRIDGE=1
dbus-run-session
meson test --no-stdsplit --print-errorlogs ${TEST_RUN_ARGS}
END
artifacts:
name: 'Flatpak artifacts'
expose_as: 'Get Flatpak bundle here'
......
Building
========
For build instructions see the README.md
Pull requests
=============
Before filing a pull request run the tests:
```sh
ninja -C _build test
```
Use descriptive commit messages, see
https://wiki.gnome.org/Git/CommitMessages
and check
https://wiki.openstack.org/wiki/GitCommitMessages
for good examples.
Coding Style
============
While much of the original codebase was written using [GNU's Coding Style][1],
please try to follow this document for newly written code.
For existing code you should probably try to not mix different code styles too much.
This coding style is heavily inspired/copied from [phosh's Coding Style][2]
which itself is mostly using [libhandy's Coding Style][3].
These are the differences:
- We're not picky about GTK+ style function argument indentation, that is
having multiple arguments on one line is also o.k.
- For callbacks we additionally allow for the `on_<action>` pattern e.g.
`on_feedback_ended ()` since this helps to keep the namespace
clean.
- Since we're not a library we usually use `G_DEFINE_TYPE` instead of
`G_DEFINE_TYPE_WITH_PRIVATE` (except when we need a deriveable
type) since it makes the rest of the code more compact.
Source file layout
------------------
We use one file per GObject. It should be named like the GObject with
the calls prefix, lowercase and '_' replaced by '-'. So a hypothetical
`CallsThing` would go to `src/calls-thing.c`. The
individual C files should be structured as (top to bottom of file):
- License boilerplate
```c
/*
* Copyright (C) year copyright holder
*
* SPDX-License-Identifier: GPL-3-or-later
* Author: you <youremail@example.com>
*/
```
- A log domain
```C
#define G_LOG_DOMAIN "CallsThing"
```
Usually just the GObject.
- `#include`s:
Calls ones go first, then glib/gtk, then generic C headers. These blocks
are separated by newline and each sorted alphabetically:
```
#define G_LOG_DOMAIN "CallsThing"
#include "calls-things.h"
#include "calls-other-things.h"
#include <gio/gdesktopappinfo.h>
#include <glib/glib.h>
#include <math.h>
```
This helps to detect missing headers in includes.
- docstring
- property enum
```c
enum {
PROP_0,
PROP_FOO,
PROP_BAR,,
LAST_PROP
};
static GParamSpec *props[LAST_PROP];
```
- signal enum
```c
enum {
FOO_HAPPENED,
BAR_TRIGGERED,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
```
- type definitions
```c
typedef struct _CallsThing {
GObject parent;
...
} CallsThing;
G_DEFINE_TYPE (CallsThing, calls_thing, G_TYPE_OBJECT)
```
- private methods and callbacks (these can also go at convenient
places above `calls_thing_constructed ()`
- `calls_thing_set_properties ()`
- `calls_thing_get_properties ()`
- `calls_thing_constructed ()`
- `calls_thing_dispose ()`
- `calls_thing_finalize ()`
- `calls_thing_class_init ()`
- `calls_thing_init ()`
- `calls_thing_new ()`
- Public methods, all starting with the object name(i.e. `calls_thing_`)
The reason public methods go at the bottom is that they have declarations in
the header file and can thus be referenced from anywhere else in the source
file.
Try to avoid forward declarations where possible.
[1]: https://www.gnu.org/prep/standards/standards.html#Formatting
[2]: https://source.puri.sm/Librem5/phosh/blob/master/HACKING.md#coding-style
[3]: https://source.puri.sm/Librem5/libhandy/blob/master/HACKING.md#coding-style
......@@ -36,6 +36,12 @@ If using ModemManager, Calls will wait for ModemManager to appear on
D-Bus and then wait for usable modems to appear. The UI will be
inactive and display a status message until a usable modem appears.
When running from the source tree you can use `CALLS_PLUGIN_DIR` environment
varible to specify the directroy from where plugins are loaded. To e.g. load
the dummy plugin from the source tree:
export CALLS_PLUGIN_DIR=_build/plugins/dummy/
_build/src/gnome-calls -p dummy
### oFono
There is also an oFono backend, "ofono". This was the first backend
......
gnome-calls (0.3.2-1) experimental; urgency=medium
* d/patches: Remove upstreamed patches
* d/control: Add gstreamer dependencies
* d/control: Add sofia dependency
* d/control: bump required libhandy to >=1.1.90
* d/salsa-ci.yml: Build against experimental
* d/patches: Don't use DNS lookups during tests
-- Evangelos Ribeiro Tzaras <devrtz-debian@fortysixandtwo.eu> Fri, 23 Apr 2021 15:03:42 +0200
gnome-calls (0.3.0-2) experimental; urgency=medium
* d/patches: fix double free
......
......@@ -8,6 +8,7 @@ Uploaders:
Build-Depends:
debhelper-compat (= 13),
desktop-file-utils,
gstreamer1.0-plugins-good,
gtk-doc-tools <!nodoc>,
help2man,
libcallaudio-dev (>= 0.0.5),
......@@ -16,11 +17,13 @@ Build-Depends:
libfolks-dev,
libgom-1.0-dev,
libgsound-dev,
libgstreamer1.0-dev,
libgtk-3-dev,
libgtk-3-doc <!nodoc>,
libhandy-1-dev,
libhandy-1-dev (>=1.1.90),
libmm-glib-dev (>= 1.12.0),
libpeas-dev,
libsofia-sip-ua-glib-dev,
meson,
modemmanager-dev,
pkg-config,
......@@ -37,6 +40,7 @@ Package: gnome-calls
Architecture: any
Depends:
callaudiod,
gstreamer1.0-plugins-good,
modemmanager,
${misc:Depends},
${shlibs:Depends},
......
From d75a08b9b7e45d22b75772848d83a9ef8ee9e5fe Mon Sep 17 00:00:00 2001
From: Evangelos Ribeiro Tzaras <evangelos.tzaras@puri.sm>
Date: Tue, 16 Feb 2021 02:59:24 +0100
Subject: [PATCH] application: Fix double free
The double free was introduced in 46e4422.
This fixes #225
---
src/calls-application.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/calls-application.c b/src/calls-application.c
index 05eaef5..f8cfdf7 100644
--- a/src/calls-application.c
+++ b/src/calls-application.c
@@ -188,8 +188,6 @@ check_dial_number (const gchar *number)
matches = g_regex_match (reject, number, 0, NULL);
- g_regex_unref (reject);
-
return !matches;
}
--
2.30.0
From: Evangelos Ribeiro Tzaras <devrtz-debian@fortysixandtwo.eu>
Subject: Do not use DNS lookups during tests
--- a/tests/test-sip.c
+++ b/tests/test-sip.c
@@ -263,13 +263,13 @@
g_object_get (fixture->origin_alice,
"local-port", &local_port_alice,
NULL);
- address_alice = g_strdup_printf ("sip:alice@localhost:%d",
+ address_alice = g_strdup_printf ("sip:alice@127.0.0.1:%d",
local_port_alice);
g_object_get (fixture->origin_bob,
"local-port", &local_port_bob,
NULL);
- address_bob = g_strdup_printf ("sip:bob@localhost:%d",
+ address_bob = g_strdup_printf ("sip:bob@127.0.0.1:%d",
local_port_bob);
/* Case 1: Bob calls Alice, Alice rejects call */
0001-application-Fix-double-free.patch
0001-fix-dns-errors-during-tests.patch
......@@ -2,3 +2,11 @@
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
variables:
SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 1
RELEASE: 'experimental'
# Since those pull from unstable
SALSA_CI_DISABLE_REPROTEST: 1
SALSA_CI_DISABLE_PIUPARTS: 1
SALSA_CI_DISABLE_AUTOPKGTEST: 1
......@@ -12,11 +12,11 @@ if get_option('gtk_doc')
calls_vala_sources,
dependencies: calls_vala_deps)
calls_doc_lib = library('calls-doc',
[calls_sources, calls_enum_sources, wayland_sources, wl_proto_sources, gdbofono_src],
[calls_sources, gdbofono_src],
include_directories: calls_includes,
link_with: calls_vala_doc_lib,
dependencies: calls_deps)
calls_doc_deps = declare_dependency(sources: [calls_sources, calls_enum_sources, wayland_sources, wl_proto_sources, calls_vala_sources],
calls_doc_deps = declare_dependency(sources: [calls_sources, calls_vala_sources],
include_directories: calls_includes,
link_with: [calls_doc_lib, calls_vala_doc_lib],
dependencies: [calls_deps, calls_vala_deps])
......
#
# Copyright (C) 2018 Purism SPC
#
# This file is part of Dialer.
# This file is part of Calls.
#
# Dialer is free software: you can redistribute it and/or modify
# Calls is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dialer is distributed in the hope that it will be useful,
# Calls is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Dialer. If not, see <http://www.gnu.org/licenses/>.
# along with Calls. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
......@@ -22,7 +22,7 @@
project(
'calls',
'c', 'vala',
version: '0.3.0',
version: '0.3.2',
license: 'GPLv3+',
meson_version: '>= 0.47.0',
default_options: [
......
......@@ -37,25 +37,16 @@ struct _CallsDummyCall
CallsCallState state;
};
static void calls_dummy_call_message_source_interface_init (CallsCallInterface *iface);
static void calls_dummy_call_call_interface_init (CallsCallInterface *iface);
static void calls_dummy_call_message_source_interface_init (CallsMessageSourceInterface *iface);
G_DEFINE_TYPE_WITH_CODE (CallsDummyCall, calls_dummy_call, G_TYPE_OBJECT,
G_DEFINE_TYPE_WITH_CODE (CallsDummyCall, calls_dummy_call, CALLS_TYPE_CALL,
G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
calls_dummy_call_message_source_interface_init)
G_IMPLEMENT_INTERFACE (CALLS_TYPE_CALL,
calls_dummy_call_call_interface_init))
calls_dummy_call_message_source_interface_init))
enum {
PROP_0,
PROP_NUMBER_CONSTRUCTOR,
PROP_INBOUND_CONSTRUCTOR,
PROP_CALL_NUMBER,
PROP_CALL_INBOUND,
PROP_CALL_STATE,
PROP_CALL_NAME,
PROP_LAST_PROP
};
static GParamSpec *props[PROP_LAST_PROP];
......@@ -73,15 +64,39 @@ change_state (CallsCall *call,
}
self->state = state;
g_object_notify_by_pspec (G_OBJECT (call), props[PROP_CALL_STATE]);
g_object_notify (G_OBJECT (self), "state");
g_signal_emit_by_name (call,
"state-changed",
state,
old_state);
}
static const char *
calls_dummy_call_get_number (CallsCall *call)
{
CallsDummyCall *self = CALLS_DUMMY_CALL (call);
return self->number;
}
static CallsCallState
calls_dummy_call_get_state (CallsCall *call)
{
CallsDummyCall *self = CALLS_DUMMY_CALL (call);
return self->state;
}
static gboolean
calls_dummy_call_get_inbound (CallsCall *call)
{
CallsDummyCall *self = CALLS_DUMMY_CALL (call);
return self->inbound;
}
static void
answer (CallsCall *call)
calls_dummy_call_answer (CallsCall *call)
{
CallsDummyCall *self;
......@@ -94,7 +109,7 @@ answer (CallsCall *call)
}
static void
hang_up (CallsCall *call)
calls_dummy_call_hang_up (CallsCall *call)
{
CallsDummyCall *self;
......@@ -104,19 +119,6 @@ hang_up (CallsCall *call)
change_state (call, self, CALLS_CALL_STATE_DISCONNECTED);
}
static void
tone_start (CallsCall *call, gchar key)
{
g_info ("Beep! (%c)", (int)key);
}
static void
tone_stop (CallsCall *call, gchar key)
{
g_info ("Beep end (%c)", (int)key);
}
static gboolean
outbound_timeout_cb (CallsDummyCall *self)
{
......@@ -197,39 +199,6 @@ constructed (GObject *object)
G_OBJECT_CLASS (calls_dummy_call_parent_class)->constructed (object);
}
static void
get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
CallsDummyCall *self = CALLS_DUMMY_CALL (object);
switch (property_id) {
case PROP_CALL_INBOUND:
g_value_set_boolean (value, self->inbound);
break;
case PROP_CALL_NUMBER:
g_value_set_string (value, self->number);
break;
case PROP_CALL_STATE:
g_value_set_enum (value, self->state);
break;
case PROP_CALL_NAME:
g_value_set_string (value, NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
finalize (GObject *object)
{
......@@ -245,12 +214,18 @@ static void
calls_dummy_call_class_init (CallsDummyCallClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CallsCallClass *call_class = CALLS_CALL_CLASS (klass);
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->constructed = constructed;
object_class->finalize = finalize;
call_class->get_number = calls_dummy_call_get_number;
call_class->get_state = calls_dummy_call_get_state;
call_class->get_inbound = calls_dummy_call_get_inbound;
call_class->answer = calls_dummy_call_answer;
call_class->hang_up = calls_dummy_call_hang_up;
props[PROP_NUMBER_CONSTRUCTOR] =
g_param_spec_string ("number-constructor",
"Number (constructor)",
......@@ -266,32 +241,10 @@ calls_dummy_call_class_init (CallsDummyCallClass *klass)
FALSE,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class, PROP_INBOUND_CONSTRUCTOR, props[PROP_INBOUND_CONSTRUCTOR]);
#define IMPLEMENTS(ID, NAME) \
g_object_class_override_property (object_class, ID, NAME); \
props[ID] = g_object_class_find_property(object_class, NAME);
IMPLEMENTS(PROP_CALL_NUMBER, "number");
IMPLEMENTS(PROP_CALL_INBOUND, "inbound");
IMPLEMENTS(PROP_CALL_STATE, "state");
IMPLEMENTS(PROP_CALL_NAME, "name");
#undef IMPLEMENTS
}
static void
calls_dummy_call_call_interface_init (CallsCallInterface *iface)
{
iface->answer = answer;
iface->hang_up = hang_up;
iface->tone_start = tone_start;
iface->tone_stop = tone_stop;
}
static void
calls_dummy_call_message_source_interface_init (CallsCallInterface *iface)
calls_dummy_call_message_source_interface_init (CallsMessageSourceInterface *iface)
{
}
......
......@@ -27,11 +27,13 @@
#include <glib-object.h>
#include "calls-call.h"
G_BEGIN_DECLS
#define CALLS_TYPE_DUMMY_CALL (calls_dummy_call_get_type ())
G_DECLARE_FINAL_TYPE (CallsDummyCall, calls_dummy_call, CALLS, DUMMY_CALL, GObject);
G_DECLARE_FINAL_TYPE (CallsDummyCall, calls_dummy_call, CALLS, DUMMY_CALL, CallsCall)
CallsDummyCall *calls_dummy_call_new (const gchar *number,
gboolean inbound);
......
......@@ -58,6 +58,7 @@ enum {
PROP_NAME,
PROP_CALLS,
PROP_COUNTRY_CODE,
PROP_LAST_PROP,
};
static GParamSpec *props[PROP_LAST_PROP];
......@@ -132,13 +133,13 @@ add_call (CallsDummyOrigin *self, const gchar *number, gboolean inbound)
g_assert (dummy_call != NULL);
call = CALLS_CALL (dummy_call);
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
g_signal_connect_swapped (call, "state-changed",
G_CALLBACK (call_state_changed_cb),
self);
self->calls = g_list_append (self->calls, dummy_call);
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
}
......@@ -198,6 +199,10 @@ get_property (GObject *object,
g_value_set_pointer (value, g_list_copy (self->calls));
break;
case PROP_COUNTRY_CODE:
g_value_set_string (value, NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -252,6 +257,7 @@ calls_dummy_origin_class_init (CallsDummyOriginClass *klass)
IMPLEMENTS (PROP_NAME, "name");
IMPLEMENTS (PROP_CALLS, "calls");
IMPLEMENTS (PROP_COUNTRY_CODE, "country-code");
#undef IMPLEMENTS
}
......
......@@ -35,7 +35,7 @@ struct _CallsDummyProvider
{
CallsProvider parent_instance;
GList *origins;
GListStore *origins;
};
static void calls_dummy_provider_message_source_interface_init (CallsMessageSourceInterface *iface);
......@@ -61,13 +61,15 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED
static gboolean
usr1_handler (CallsDummyProvider *self)
{
CallsDummyOrigin *origin;
GListModel *model;
g_autoptr(CallsDummyOrigin) origin = NULL;
g_return_val_if_fail (self->origins != NULL, FALSE);
model = G_LIST_MODEL (self->origins);
g_return_val_if_fail (g_list_model_get_n_items (model) > 0, FALSE);
g_debug ("Received SIGUSR1, adding new incoming call");
origin = CALLS_DUMMY_ORIGIN (self->origins->data);
origin = g_list_model_get_item (model, 0);
calls_dummy_origin_create_inbound (origin, "0987654321");