From a888ac54b182e8c066a5ffb4f71925a13fdc7ba5 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Tue, 20 Apr 2021 02:07:19 +0200 Subject: [PATCH] mm: origin: Try using own number as the origin name This will make it easier to select an origin for outgoing calls. Without this change the name might be "0" which is not very expressive. --- plugins/mm/calls-mm-origin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/mm/calls-mm-origin.c b/plugins/mm/calls-mm-origin.c index 6917948..7525ba1 100644 --- a/plugins/mm/calls-mm-origin.c +++ b/plugins/mm/calls-mm-origin.c @@ -663,7 +663,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); \