Commit 16284a35 authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

New upstream version 0.3.4

parent 912ef6a4
((nil . ((indent-tabs-mode . nil))))
((nil . ((indent-tabs-mode . nil)))
;; thanks to Mohammed Sadiq, see https://source.puri.sm/Librem5/calls/-/merge_requests/332#note_159469
(c-mode . ((c-macro-names-with-semicolon
. ("G_BEGIN_DECLS" "G_END_DECLS" "G_DECLARE_FINAL_TYPE" "G_DEFINE_QUARK"
"G_DECLARE_DERIVABLE_TYPE" "G_DECLARE_INTERFACE" "G_DEFINE_TYPE"
"G_DEFINE_TYPE_WITH_PRIVATE" "G_DEFINE_ABSTRACT_TYPE"
"G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE")))))
......@@ -72,46 +72,3 @@ check-po:
# in this case
- cd po/
- intltool-update -m 2>&1 | grep -qs '/.*\.c' && { intltool-update -m; exit 1; } || exit 0
# For some reason including https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml fails, therefore it's copied here
.flatpak:
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
stage: 'package'
interruptible: true
tags:
- flatpak
script:
- rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE} ${CONFIG_OPTS}
- flatpak-builder --user --disable-rofiles-fuse flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
# Generate a Flatpak bundle
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
- tar cf repo.tar repo/
artifacts:
name: 'Flatpak artifacts'
expose_as: 'Get Flatpak bundle here'
when: 'always'
paths:
- "${BUNDLE}"
- 'repo.tar'
- '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/meson-log.txt'
- '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/testlog.txt'
expire_in: 14 days
cache:
key: "$CI_JOB_NAME"
paths:
- '.flatpak-builder/downloads'
- '.flatpak-builder/git'
flatpak:master:
extends: .flatpak
stage: package
variables:
MANIFEST_PATH: "sm.puri.Calls.json"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
FLATPAK_MODULE: "calls"
# Make sure to keep this in sync with the Flatpak manifest, all arguments
# are passed except the config-args because we build it ourselves
MESON_ARGS: ""
APP_ID: "sm.puri.Calls"
BUNDLE: 'calls.flatpak'
......@@ -19,10 +19,20 @@ If you are running a Debian based distribution, you can easily install all those
We use the meson and thereby Ninja. The quickest way to get going is
to do the following:
meson -Dprefix=/usr/local/stow/calls-git ../calls-build
ninja -C ../calls-build
ninja -C ../calls-build install
meson . _build
ninja -C _build
ninja -C _build install
If you don't want to pollute your filesystem please be aware, that you can also
use `--prefix=~/install`.
### Build the documentation
If you want to build the documentation you have to configure the meson project
with `-Ggtk_doc=true`
meson . _build -Dgtk_doc=true
ninja -C _build
ninja -C _build calls-doc
## Running
Calls has a variety of backends. The default backend is "mm", which
......@@ -31,18 +41,27 @@ command-line option. For example, to run with the dummy backend and
some useful debugging output:
export G_MESSAGES_DEBUG=all
/usr/local/stow/calls-git/bin/calls -p dummy
/usr/local/bin/gnome-calls -p dummy
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:
### Running from the build directory
You can run calls without having to install it by executing the run script in
the build folder, i.e. `_build/run`. This script will setup the needed environment
and start Calls.
### Call provider backends
Call provider backends are compiled as plugins and can be loaded and unloaded at runtime
using the `-p` command line flag, followed by the plugin name.
Setting the `CALLS_PLUGIN_DIR` environment variable will include the specified
directory in the plugin search path. F.e.
export CALLS_PLUGIN_DIR=_build/plugins/
/usr/local/bin/gnome-calls -p dummy
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
......@@ -65,7 +84,7 @@ useful to bring up a modem to a suitable state. For example:
Then run Calls:
/usr/local/stow/calls-git/bin/calls -p ofono
/usr/bin/gnome-calls -p ofono
#### Phonesim
......
......@@ -67,3 +67,18 @@ install_data(
'apps'
)
)
schema_src = 'sm.puri.Calls.gschema.xml'
compiled = gnome.compile_schemas(build_by_default: true,
depends_files: files(schema_src))
install_data(schema_src,
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)
compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
test('Validate schema file', compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()]
)
endif
......@@ -12,5 +12,5 @@ Type=Application
StartupNotify=true
Terminal=false
Categories=Network;GNOME;GTK;Telephony;
MimeType=x-scheme-handler/tel
MimeType=x-scheme-handler/tel;x-scheme-handler/sip;x-scheme-handler/sips
X-Purism-FormFactor=Workstation;Mobile;
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="purism-calls">
<schema id="sm.puri.Calls" path="/sm/puri/Calls/">
<key name="auto-use-default-origins" type="b">
<default>true</default>
<summary>Whether calls should automatically use the default origin</summary>
<description>Whether calls should automatically use the default origin</description>
</key>
<key name="country-code" type="s">
<default>''</default>
<summary>The country code as reported by the modem</summary>
<description>The country code is used for contact name lookup</description>
</key>
</schema>
</schemalist>
gnome-calls (0.3.4) byzantium; urgency=medium
[ Evangelos Ribeiro Tzaras ]
* manager: Set peas search path only once
* provider: whitespace and indentation
* cleanup: Fix calls_origin_get_name() related memory leaks
* mm: origin: Try using own number as the origin name
* account-provider: Add debugging in the public functions
* plugins: provider: Use CallsOrigin instead of derived types for GListStore
* util: Add simple API to query protocol
* test: Add util tests
* call: Introduce protocol property
* calls-record: Introduce the protocol property
* provider: Add API to query supported protocols
* origin: Add API to query supported protocols
* manager: support multiple providers
* application: Add CallsSettings class
* new-call-box: Honour auto-use-default-origins setting
* application: Don't add a provider if one is already present
* manager: Differentiate the NO_ORIGIN state
* test: manager: Use more appropriate `g_assert_*()` calls
* sip: provider: Don't warn when trying to add account multiple times
* tests: manager: Add multiple provider tests
* application: settings: Add country code setting
* manager: Update country code
* ci: disable flatpak build
* d/control: Add libxml2-utils
* meson: Compile schemas in build directory
* Add run script to the build directory
* Update README: Explain how to start calls without installing
* Initial DBus API
* display: codestyle
* display: Fix typo
* record-store: codestyle
* Fix old-style warnings all over the codebase
* Fix missing-declarations warnings all over the codebase
* sip: media-pipeline: Don't shadow props variable
* ofono: call: Don't shadow props variable
* mm: origin: Don't shadow props variable
* call-display: Add default case to switch statement
* record-store: Add default case to switch statements
* main-window: Add default case to switch statement
* meson: Use stricter compilation warnings and errors
* desktop-file: Register as sip and sips URI scheme handler
* run: Add plugin search directory
* README: Reword plugin search directory section to be more accurate
* dir-locals: Treat G_* macros as including a semicolon
* manager: Fix whitespace
* manager: codestyle
* sip: origin: Fix if condition in dispose()
* util: Make position argument in calls_find_store() optional
* test: manager: Expanded *has_provider() testing
[ Anders Jonsson ]
* po: Update Swedish translation
[ Yuri Chornoivan ]
* po: Update Ukrainian translation
[ Vittorio Monti ]
* po: Update Italian translation
[ Guido Günther ]
* Expose call objects on DBus
-- Evangelos Ribeiro Tzaras <evangelos.tzaras@puri.sm> Sat, 12 Jun 2021 17:21:31 +0200
gnome-calls (0.3.3) byzantium; urgency=medium
[ Evangelos Ribeiro Tzaras ]
......
......@@ -22,6 +22,7 @@ Build-Depends:
libmm-glib-dev (>= 1.12.0),
libpeas-dev,
libsofia-sip-ua-glib-dev,
libxml2-utils,
meson,
modemmanager-dev,
pkg-config,
......
......@@ -2,6 +2,7 @@
/usr/bin
/usr/lib
/usr/share/applications
/usr/share/glib-2.0
/usr/share/icons
/usr/share/locale
/usr/share/metainfo
......@@ -35,4 +35,9 @@
<xi:include href="xml/calls-call.xml"/>
</chapter>
<chapter id="dbus">
<title>DBus interfaces</title>
<xi:include href="../src/dbus/calls-sm.puri.Calls.Call.xml"/>
</chapter>
</book>
......@@ -27,6 +27,7 @@ gnome.gtkdoc('calls',
src_dir: [
join_paths(meson.source_root(), 'src'),
join_paths(meson.build_root(), 'src'),
join_paths(meson.build_root(), 'src/dbus'),
join_paths(meson.build_root(), 'plugins/ofono/libgdbofono'),
],
dependencies: calls_doc_deps,
......
......@@ -22,7 +22,7 @@
project(
'calls',
'c', 'vala',
version: '0.3.3',
version: '0.3.4',
license: 'GPLv3+',
meson_version: '>= 0.47.0',
default_options: [
......@@ -58,10 +58,63 @@ config_data.set_quoted('PACKAGE_URL', calls_homepage)
config_data.set_quoted('PACKAGE_VERSION', calls_version)
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_64',
], language: 'c')
run_data = configuration_data()
run_data.set('ABS_BUILDDIR', meson.current_build_dir())
run_data.set('ABS_SRCDIR', meson.current_source_dir())
configure_file(
input: 'run.in',
output: 'run',
configuration: run_data)
cc = meson.get_compiler('c')
global_c_args = []
test_c_args = [
'-Wcast-align',
'-Wdate-time',
'-Wdeclaration-after-statement',
['-Werror=format-security', '-Werror=format=2'],
'-Wendif-labels',
'-Werror=incompatible-pointer-types',
'-Werror=missing-declarations',
'-Werror=overflow',
'-Werror=return-type',
'-Werror=shift-count-overflow',
'-Werror=shift-overflow=2',
'-Wfloat-equal',
'-Wformat-nonliteral',
'-Wformat-security',
'-Winit-self',
'-Wmaybe-uninitialized',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wnested-externs',
'-Wold-style-definition',
'-Wshadow',
'-Wstrict-prototypes',
'-Wswitch-default',
'-Wno-switch-enum',
'-Wtype-limits',
'-Wunused-function',
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_58',
' -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66',
]
if get_option('buildtype') != 'plain'
test_c_args += '-fstack-protector-strong'
endif
foreach arg: test_c_args
if cc.has_multi_arguments(arg)
global_c_args += arg
endif
endforeach
add_project_arguments(
global_c_args,
language: 'c'
)
subdir('po')
subdir('src')
......@@ -69,3 +122,4 @@ subdir('plugins')
subdir('doc')
subdir('data')
subdir('tests')
......@@ -95,6 +95,12 @@ calls_dummy_call_get_inbound (CallsCall *call)
return self->inbound;
}
static const char*
calls_dummy_call_get_protocol (CallsCall *call)
{
return "tel";
}
static void
calls_dummy_call_answer (CallsCall *call)
{
......@@ -223,6 +229,7 @@ calls_dummy_call_class_init (CallsDummyCallClass *klass)
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->get_protocol = calls_dummy_call_get_protocol;
call_class->answer = calls_dummy_call_answer;
call_class->hang_up = calls_dummy_call_hang_up;
......
......@@ -153,6 +153,17 @@ dial (CallsOrigin *origin, const gchar *number)
}
static gboolean
supports_protocol (CallsOrigin *origin,
const char *protocol)
{
g_assert (protocol != NULL);
g_assert (CALLS_IS_DUMMY_ORIGIN (origin));
return TRUE;
}
CallsDummyOrigin *
calls_dummy_origin_new (const gchar *name)
{
......@@ -273,6 +284,7 @@ static void
calls_dummy_origin_origin_interface_init (CallsOriginInterface *iface)
{
iface->dial = dial;
iface->supports_protocol = supports_protocol;
}
......
......@@ -30,6 +30,10 @@
#include <libpeas/peas.h>
#include <glib-unix.h>
static const char * const supported_protocols[] = {
"tel",
NULL
};
struct _CallsDummyProvider
{
......@@ -95,6 +99,12 @@ calls_dummy_provider_get_origins (CallsProvider *provider)
return G_LIST_MODEL (self->origins);
}
static const char * const *
calls_dummy_provider_get_protocols (CallsProvider *provider)
{
return supported_protocols;
}
static void
constructed (GObject *object)
{
......@@ -134,6 +144,7 @@ calls_dummy_provider_class_init (CallsDummyProviderClass *klass)
provider_class->get_name = calls_dummy_provider_get_name;
provider_class->get_status = calls_dummy_provider_get_status;
provider_class->get_origins = calls_dummy_provider_get_origins;
provider_class->get_protocols = calls_dummy_provider_get_protocols;
}
......@@ -146,7 +157,7 @@ calls_dummy_provider_message_source_interface_init (CallsMessageSourceInterface
static void
calls_dummy_provider_init (CallsDummyProvider *self)
{
self->origins = g_list_store_new (CALLS_TYPE_DUMMY_ORIGIN);
self->origins = g_list_store_new (CALLS_TYPE_ORIGIN);
}
......@@ -162,7 +173,7 @@ calls_dummy_provider_add_origin (CallsDummyProvider *self,
CallsDummyProvider *
calls_dummy_provider_new ()
calls_dummy_provider_new (void)
{
return g_object_new (CALLS_TYPE_DUMMY_PROVIDER, NULL);
}
......
......@@ -25,19 +25,21 @@
#ifndef CALLS_DUMMY_PROVIDER_H__
#define CALLS_DUMMY_PROVIDER_H__
#include <glib-object.h>
#include "calls-provider.h"
#include <glib-object.h>
#include <libpeas/peas.h>
G_BEGIN_DECLS
#define CALLS_TYPE_DUMMY_PROVIDER (calls_dummy_provider_get_type ())
G_DECLARE_FINAL_TYPE (CallsDummyProvider, calls_dummy_provider, CALLS, DUMMY_PROVIDER, CallsProvider)
CallsDummyProvider *calls_dummy_provider_new ();
CallsDummyProvider *calls_dummy_provider_new (void);
void calls_dummy_provider_add_origin (CallsDummyProvider *self,
const gchar *name);
void peas_register_types (PeasObjectModule *module);
G_END_DECLS
......
......@@ -216,6 +216,12 @@ calls_mm_call_get_inbound (CallsCall *call)
return FALSE;
}
static const char *
calls_mm_call_get_protocol (CallsCall *self)
{
return "tel";
}
struct CallsMMOperationData
{
const gchar *desc;
......@@ -375,6 +381,7 @@ calls_mm_call_class_init (CallsMMCallClass *klass)
call_class->get_number = calls_mm_call_get_number;
call_class->get_state = calls_mm_call_get_state;
call_class->get_inbound = calls_mm_call_get_inbound;
call_class->get_protocol = calls_mm_call_get_protocol;
call_class->answer = calls_mm_call_answer;
call_class->hang_up = calls_mm_call_hang_up;
call_class->tone_start = calls_mm_call_tone_start;
......
......@@ -323,21 +323,32 @@ static void
dial (CallsOrigin *origin, const gchar *number)
{
CallsMMOrigin *self = CALLS_MM_ORIGIN (origin);
MMCallProperties *props;
MMCallProperties *call_props;
g_assert (self->voice != NULL);
props = mm_call_properties_new();
mm_call_properties_set_number (props, number);
call_props = mm_call_properties_new ();
mm_call_properties_set_number (call_props, number);
mm_modem_voice_create_call
(self->voice,
props,
call_props,
NULL,
(GAsyncReadyCallback) dial_cb,
self);
g_object_unref (props);
g_object_unref (call_props);
}
static gboolean
supports_protocol (CallsOrigin *origin,
const char *protocol)
{
g_assert (protocol);
g_assert (CALLS_IS_MM_ORIGIN (origin));
return g_strcmp0 (protocol, "tel") == 0;
}
......@@ -663,7 +674,14 @@ get_property (GObject *object,
static gchar *
modem_get_name (MMModem *modem)
{
gchar *name = NULL;
char *name = NULL;
const char * const *numbers = NULL;
numbers = mm_modem_get_own_numbers (modem);
if (numbers && g_strv_length ((char **) numbers) > 0) {
name = g_strdup (numbers[0]);
return name;
}
#define try(prop) \
name = mm_modem_dup_##prop (modem); \
......@@ -890,6 +908,7 @@ static void
calls_mm_origin_origin_interface_init (CallsOriginInterface *iface)
{
iface->dial = dial;
iface->supports_protocol = supports_protocol;
}
......
......@@ -32,6 +32,11 @@
#include <libpeas/peas.h>
#include <glib/gi18n.h>
static const char * const supported_protocols[] = {
"tel",
NULL
};
struct _CallsMMProvider
{
CallsProvider parent_instance;
......@@ -91,7 +96,7 @@ update_status (CallsMMProvider *self)
}
gboolean
static gboolean
mm_provider_contains (CallsMMProvider *self,
MMObject *mm_obj)
{
......@@ -247,7 +252,7 @@ add_mm_objects (CallsMMProvider *self)
}
void
static void
object_added_cb (CallsMMProvider *self,
GDBusObject *object)
{
......@@ -258,7 +263,7 @@ object_added_cb (CallsMMProvider *self,
}
void
static void
object_removed_cb (CallsMMProvider *self,
GDBusObject *object)
{
......@@ -321,7 +326,7 @@ mm_appeared_cb (GDBusConnection *connection,
}
void
static void
mm_vanished_cb (GDBusConnection *connection,
const gchar *name,
CallsMMProvider *self)
......@@ -354,6 +359,18 @@ calls_mm_provider_get_origins (CallsProvider *provider)
return G_LIST_MODEL (self->origins);
}
static const char * const *
calls_mm_provider_get_protocols (CallsProvider *provider)
{