From a3b549565e5e2c8ed2f15ee6cd4b96039700e613 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Fri, 11 May 2018 11:50:34 -0500 Subject: [PATCH 1/2] Add WeChatScheme --- urns/urns.go | 4 ++++ urns/urns_test.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/urns/urns.go b/urns/urns.go index 380640a..1025bd1 100644 --- a/urns/urns.go +++ b/urns/urns.go @@ -47,6 +47,9 @@ const ( // WhatsAppScheme is the scheme used for WhatsApp identifiers WhatsAppScheme string = "whatsapp" + // WeChatScheme is the scheme used for WeChat identifiers + WeChatScheme string = "wechat" + // FacebookRefPrefix is the path prefix used for facebook referral URNs FacebookRefPrefix string = "ref:" ) @@ -65,6 +68,7 @@ var ValidSchemes = map[string]bool{ TwitterScheme: true, ViberScheme: true, WhatsAppScheme: true, + WeChatScheme: true, } // IsValidScheme checks whether the provided scheme is valid diff --git a/urns/urns_test.go b/urns/urns_test.go index 308dc17..4feaf0a 100644 --- a/urns/urns_test.go +++ b/urns/urns_test.go @@ -242,6 +242,9 @@ func TestValidate(t *testing.T) { {"jiochat:12345", ""}, {"jiochat:123de", "invalid jiochat id"}, + // WeChat Open IDs + {"wechat:o6_bmjrPTlm6_2sgVt7hMZOPfL2M", ""} + // line IDs {"line:Uasd224", ""}, {"line:Uqw!123", "invalid line id"}, From 5af6b3f51929a847a2e898fc017bdb9d7f86bea6 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Fri, 11 May 2018 11:59:37 -0500 Subject: [PATCH 2/2] Fix test --- urns/urns_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urns/urns_test.go b/urns/urns_test.go index 4feaf0a..4c89fb9 100644 --- a/urns/urns_test.go +++ b/urns/urns_test.go @@ -243,7 +243,7 @@ func TestValidate(t *testing.T) { {"jiochat:123de", "invalid jiochat id"}, // WeChat Open IDs - {"wechat:o6_bmjrPTlm6_2sgVt7hMZOPfL2M", ""} + {"wechat:o6_bmjrPTlm6_2sgVt7hMZOPfL2M", ""}, // line IDs {"line:Uasd224", ""},