Skip to content

Commit

Permalink
Merge pull request #14 from nyaruka/add-wechat-scheme
Browse files Browse the repository at this point in the history
Add WeChatScheme
  • Loading branch information
rowanseymour authored May 11, 2018
2 parents f165005 + 5af6b3f commit bc2f2eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions urns/urns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
)
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions urns/urns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit bc2f2eb

Please sign in to comment.