summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-16 16:04:52 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-16 16:04:52 +0100
commitfca62a91d78ba412911232006db5b237437557c2 (patch)
treea3b14f66637653a7777ae357629be9a9634fd0fc
parent037cb52b8f14281267c621ba5c236f06350d3c25 (diff)
downloadanastasis-gtk-fca62a91d78ba412911232006db5b237437557c2.tar.gz
anastasis-gtk-fca62a91d78ba412911232006db5b237437557c2.tar.bz2
anastasis-gtk-fca62a91d78ba412911232006db5b237437557c2.zip
require + prefix for phone number, add message (#7081)
-rw-r--r--contrib/anastasis_gtk_auth_add_sms.glade17
-rw-r--r--src/anastasis/anastasis-gtk_handle-method-sms.c4
2 files changed, 19 insertions, 2 deletions
diff --git a/contrib/anastasis_gtk_auth_add_sms.glade b/contrib/anastasis_gtk_auth_add_sms.glade
index cdd4f45..bd42f03 100644
--- a/contrib/anastasis_gtk_auth_add_sms.glade
+++ b/contrib/anastasis_gtk_auth_add_sms.glade
@@ -152,6 +152,23 @@ code you will receive by SMS.</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="phone_number_format_explainer_label">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">20</property>
+ <property name="margin-end">20</property>
+ <property name="label" translatable="yes">Enter mobile number including +CC international dialing prefix.</property>
+ <attributes>
+ <attribute name="scale" value="0.80000000000000004"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
diff --git a/src/anastasis/anastasis-gtk_handle-method-sms.c b/src/anastasis/anastasis-gtk_handle-method-sms.c
index 026a5fc..74ffa08 100644
--- a/src/anastasis/anastasis-gtk_handle-method-sms.c
+++ b/src/anastasis/anastasis-gtk_handle-method-sms.c
@@ -1,6 +1,6 @@
/*
This file is part of anastasis-gtk.
- Copyright (C) 2020 Anastasis SARL
+ Copyright (C) 2020-2021 Anastasis SARL
Anastasis is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -193,7 +193,7 @@ anastasis_gtk_b_sms_dialog_phonenumber_entry_changed_cb (GtkEntry *entry,
const char *qs;
regex_t regex;
int regex_result;
- const char *regexp = "^\\+?[0-9]+$";
+ const char *regexp = "^\\+[0-9]+$";
regex_result = regcomp (&regex,
regexp,