mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-12 15:47:35 +00:00
calls-call-record-row: Print 'Anonymous caller' on empty numbers
If no number is present use `Anonymous caller` instead of an empty label in the call history. See: #144
This commit is contained in:
parent
1ce13ba903
commit
0bc8c7bc4e
1 changed files with 22 additions and 5 deletions
|
@ -36,6 +36,9 @@
|
|||
#include <errno.h>
|
||||
|
||||
|
||||
#define ANONYMOUS_CALLER _("Anonymous caller")
|
||||
|
||||
|
||||
struct _CallsCallRecordRow
|
||||
{
|
||||
GtkListBoxRow parent_instance;
|
||||
|
@ -339,15 +342,20 @@ contact_name_cb (CallsCallRecordRow *self)
|
|||
}
|
||||
else
|
||||
{
|
||||
gchar *target;
|
||||
g_autofree gchar *target = NULL;
|
||||
|
||||
g_object_get (G_OBJECT (self->record),
|
||||
"target", &target,
|
||||
NULL);
|
||||
|
||||
if (!g_strcmp0 (target, ""))
|
||||
{
|
||||
gtk_label_set_text (self->target, ANONYMOUS_CALLER);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_label_set_text (self->target, target);
|
||||
|
||||
g_free (target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -355,7 +363,16 @@ static void
|
|||
avatar_text_changed_cb (HdyAvatar *avatar)
|
||||
{
|
||||
const gchar *text = hdy_avatar_get_text (avatar);
|
||||
hdy_avatar_set_show_initials (avatar, !g_ascii_isdigit (*text) && !strchr("#*+", *text));
|
||||
gboolean show_initials = TRUE;
|
||||
|
||||
if (strchr("#*+", *text)
|
||||
|| g_ascii_isdigit (*text)
|
||||
|| !g_strcmp0 (text, ANONYMOUS_CALLER))
|
||||
{
|
||||
show_initials = FALSE;
|
||||
}
|
||||
|
||||
hdy_avatar_set_show_initials (avatar, show_initials);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue