[next] telepathy-glib: Allow protocol names to start with "_", because tp-spec 0.99.1 says so

Simon McVittie smcv at kemper.freedesktop.org
Fri Sep 27 06:23:45 PDT 2013


Module: telepathy-glib
Branch: next
Commit: bbbb7a6319676f1257ec2d8189c8235f745b3d2f
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=bbbb7a6319676f1257ec2d8189c8235f745b3d2f

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Sep 26 19:01:12 2013 +0100

Allow protocol names to start with "_", because tp-spec 0.99.1 says so

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69855
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>

---

 telepathy-glib/connection-manager.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c
index bb8b536..72296c5 100644
--- a/telepathy-glib/connection-manager.c
+++ b/telepathy-glib/connection-manager.c
@@ -1594,7 +1594,7 @@ tp_connection_manager_check_valid_name (const gchar *name,
  *
  * Check that the given string is a valid protocol name, i.e. that
  * it consists entirely of ASCII letters, digits and hyphen/minus, and starts
- * with a letter.
+ * with a letter or underscore.
  *
  * Returns: %TRUE if @name is valid
  *
@@ -1613,11 +1613,11 @@ tp_connection_manager_check_valid_protocol_name (const gchar *name,
       return FALSE;
     }
 
-  if (!g_ascii_isalpha (name[0]))
+  if (!g_ascii_isalpha (name[0]) && name[0] != '_')
     {
       g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
           "Not a valid protocol name because first character "
-          "is not an ASCII letter: %s", name);
+          "is not an ASCII letter or underscore: %s", name);
       return FALSE;
     }
 



More information about the telepathy-commits mailing list