[ekiga] Fix regex usage in URIs
- From: Eugen Dedu <ededu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Fix regex usage in URIs
- Date: Mon, 9 Feb 2015 00:03:37 +0000 (UTC)
commit 66ce43d2c24d9dbe696a2deccf812c837a185d4b
Author: Eugen Dedu <eugen dedu univ-fcomte fr>
Date: Mon Feb 9 01:02:18 2015 +0100
Fix regex usage in URIs
Previously, calling h323 addresses in URL of dialpad was not possible.
lib/gui/gm-entry.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/lib/gui/gm-entry.h b/lib/gui/gm-entry.h
index bff744f..7c8c32a 100644
--- a/lib/gui/gm-entry.h
+++ b/lib/gui/gm-entry.h
@@ -45,11 +45,15 @@
G_BEGIN_DECLS
-#define URI_SCHEME "([A-Za-z]+:)?"
-#define SIP_URI_SCHEME "((sip|sips)+:)?"
+// ? because sip is used by default
+#define SIP_URI_SCHEME "(sip:|sips:)?"
+#define H323_URI_SCHEME "h323:"
#define BASIC_URI_PART "[A-Za-z0-9_\\-\\.]+"
#define EKIGA_URI_PART "(ekiga.net|ekiga.im)"
-#define BASIC_URI_REGEX "^" URI_SCHEME BASIC_URI_PART "@" BASIC_URI_PART "$"
+#define BASIC_SIP_URI_REGEX "^" SIP_URI_SCHEME BASIC_URI_PART "@" BASIC_URI_PART "$"
+// h323 allows to call with user or user host
+#define BASIC_H323_URI_REGEX "^" H323_URI_SCHEME BASIC_URI_PART "(@" BASIC_URI_PART ")?$"
+#define BASIC_URI_REGEX BASIC_SIP_URI_REGEX "|" BASIC_H323_URI_REGEX
#define EKIGA_URI_REGEX "^" SIP_URI_SCHEME BASIC_URI_PART "@" EKIGA_URI_PART "$"
#define PHONE_NUMBER_REGEX "^\\+?[0-9]+$"
#define NUMBER_REGEX "^[0-9]+$"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]