Skip to content

Commit bc2f2eb

Browse files
authored
Merge pull request #14 from nyaruka/add-wechat-scheme
Add WeChatScheme
2 parents f165005 + 5af6b3f commit bc2f2eb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

urns/urns.go

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const (
4747
// WhatsAppScheme is the scheme used for WhatsApp identifiers
4848
WhatsAppScheme string = "whatsapp"
4949

50+
// WeChatScheme is the scheme used for WeChat identifiers
51+
WeChatScheme string = "wechat"
52+
5053
// FacebookRefPrefix is the path prefix used for facebook referral URNs
5154
FacebookRefPrefix string = "ref:"
5255
)
@@ -65,6 +68,7 @@ var ValidSchemes = map[string]bool{
6568
TwitterScheme: true,
6669
ViberScheme: true,
6770
WhatsAppScheme: true,
71+
WeChatScheme: true,
6872
}
6973

7074
// IsValidScheme checks whether the provided scheme is valid

urns/urns_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ func TestValidate(t *testing.T) {
242242
{"jiochat:12345", ""},
243243
{"jiochat:123de", "invalid jiochat id"},
244244

245+
// WeChat Open IDs
246+
{"wechat:o6_bmjrPTlm6_2sgVt7hMZOPfL2M", ""},
247+
245248
// line IDs
246249
{"line:Uasd224", ""},
247250
{"line:Uqw!123", "invalid line id"},

0 commit comments

Comments
 (0)